How to remove .html ending with mos rewrtie
-
I have a page and I want to remove .html ending from urls. What should I write in the htaccess?
-
Did you try this?
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^([^\.]+)$ $1.html [NC,L]or to add a trailing slash:
`RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.html
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.htmlRewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]` -
neither works for me. my urls are still in domain.com/file.html format