Hello all, What are the uses of .htaccess file ? Right now i am using .htaccess file for url redirection - "canonical issue salvation" I need to remove the .html ext from my website url. For that i need .htaccess code , could any one help me
Options +FollowSymLinks Options +Indexes RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{REQUEST_URI} !mywebsite.com RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^([^\.]+)$ http://mywebsite.com/$1.html [NC,L]
I think you just need to remove the .html on the bottom line, like this: RewriteRule ^([^\.]+)$ http://mywebsite.com/$1 [NC,L] However, all your links on your website will have to point to the new urls, without .html. That has to be done manually and with care in the source.