Forum Moderators: bakedjake
I now need to modify my htaccess file to redirect htm, html, shtml files to their php counterparts.
So right now a page page1.shtml also exists as page1.php When someone enters page1.shtml I want to redirect them to page1.php and in the address bar it shows up as page1.php
My old htaccess file looks like this
ErrorDocument 404 /missing.shtml
<Files .htaccess>
order allow,deny
deny from all
</Files>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.htm$ $1 [C,E=WasHTM:yes]
RewriteCond %{REQUEST_FILENAME}.shtml -f
RewriteRule ^(.*)$ $1.shtml [S=1]
RewriteCond %{ENV:WasHTM} ^yes$
RewriteRule ^(.*)$ $1.htm
I'm wondering if there is a real clean way to do this. The site was originally done in the 90's (97 I think). there are still some links to the old htm pages which is why I need them redirected. Same with the html pages.
Thanks for any help and input you can give.