I would like to remove the .html part from the URL's that are shown in the URL.
I was able to fix that with:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
That works! :)
But now I got double URL's of every page
- page1
- page1.html
- etc.
I don't want a 404-error on the .html pages so I would like to redirect this to the page without .html (301-redirect). But i have no idea to do that in the .htaccess
I tried:
RewriteRule ^(.*)\.html$ /$1 [L,R=301]
But doesn't work --> .html files are still working
Anybody that could help me? :) Thanks!
ps. I really can't write .htaccess, please answer that I could copy-paste. That's a lot!