I’ve been asked to set up a redirect on a website.
Currently the website redirects allows you to visit http://www.site.co.uk/test instead of /test.html
The code being used is:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
I was wondering if anyone knows a way to keep this behaviour, but also redirect the .html extension to the non html version?
Try adding the following to your htaccess file in the root directory of your site.