1

I just realized that my page is also accessible when there is a .html extension on the url.

The url would be: http://musikwerkluzern.ch/programm

but http://musikwerkluzern.ch/programm.html works as well but some tags are not being rendered with the html extension attached.

And for some reason the google search results link to the page with .html attached.

enter image description here

That's bad. How can I prevent this? Is this a .htaccess thing?

1
  • After further examination I conclude it must be a server thing because other Craft sites I've made on other servers don't have this behaviour.
    – KSPR
    Commented Jan 6, 2015 at 7:07

1 Answer 1

2

Okay. I found the solution If anyone runs into the same issue. This must be a server problem which I can't solve so there is a htaccess solution to remove the .html extension:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301] 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.