Hi, I'm in the process of swapping over from static HTML to PHP. From what I understand to not lose all of the hard earned SEO I've done I need to rewrite a request for foo.htm to foo.php . After a while on Google (I'm obviously using the wrong search terms) I cannot for the life of me figger out how to do this. Can someone lend a dummy at hand? I want to rewrite foo.htm to foo.php so that someone who requests foo.htm is actually served foo.php. Cheers, Mark
Hello Mark. I think you might be able to configure your server to parse .htm files as well as .php files. (Although I could be thinking of another scripting environment.) Hopefully somebody here can give a more authoritative answer.
Hi Quadcity, Yes that's exactly what I need to do, I've managed to find the right combination of words to type into google and come up with the following: Add another apache type using: AddType application/x-httpd-php .html AddType application/x-httpd-php .htm in my .htaccess files. This means anything in a html file is parsed with php. Cheers,
This is what I use in my .htaccess file: RewriteEngine on RewriteRule ^(.+)\.html $1.php [QSA] It will probably work for you too. Keep in mind that it effects the directory you put it in + directories below this directory. If you use .htm make sure to change .html to .htm in the code above.