I’m restructuring a site now, and I’m testing it on localhost (xampp).
In the root directory there were a couple of .htm files, which were converted to .php.
However I’d like to keep the .htm extension for SEO reasons.
So I created a .htaccess file with this content:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(.*)\.php$ $1.htm [L]
But when I try to access a page like this to test rewrite:
http://localhost/sitename/anything.php
I always get to
http://localhost/C:/xampp/htdocs/sitename/anything.htm
which obviously produces a 403 error.
I have tried to change .htaccess options, but no success.
Rewrite module is enabled in Apache, so it is not the case.
Am I missing something?
Try adding a RewriteBase directive i.e.