Forum Moderators: phranque
RewriteRule ^(([^/]+/)*[^/.]+)\.s?html?$ http://www.example.com/$1.php [R=301,L]
/$1.php is a real live actual physical file in the server filesystem, then you can set things in htaccess to redirect the .html request only if the .php exists and 404 if it does not. RewriteCond $1\.php -f On my site, a user will get the 404 page, but the http error code is 301, Moved Permanently.
1. why does a user see a custom 404 page? Is it because I haven't defined a 301 customised page?
RewriteRule ^(([^/]+/)*[^/.]+)\.s?html?$ http://www.example.com/$1.php [R=301,L]