Forum Moderators: open
I'm currently changing some of my .htm pages over to .php. All my pages are currently listed in Google, and rank quite well for my chosen keyphrases.
My plan is as follows:
1) Rename *all* the .htm files to .php, even those which don't necessarily need it at the moment.
2) Use the following in .htaccess to put a 301 redirect on all requests for .htm files, which will redirect to the .php file of the same name:
RedirectMatch permanent ^(.*)\.htm $1.php
I've tested this line; it appears to work fine, and the server does the 301 properly.
Research on this forum suggests that this will be all fine and hunky-dory with Google, and I've had Google handle less-complicated 301s absolutely fine in the past.
Anything I've overlooked?
Thanks all,
Graham
Cheers
hehehe... tres cool, isn't it?
I'm looking over a site now that didn't do that, and it's totally messed up with an .htm and .shtml homepage, PR and internal links (same thing as with a change to .php). It won't be hard to fix, but there's no need for that to begin with if people will check it out in advance and stick to the simple, logical basics.
Cheers
You can in fact do something like this to only parse the pages you need:
AddHandler application/x-httpd-php index.htm
AddHandler application/x-httpd-php shop.htm
AddHandler application/x-httpd-php forum.htm
etc
etc
If you do allow all .htm to run through the php then you can also set zlib.output_compression = On in php.ini (if you are on your own server) and this will compress the page code if the browser supports it resulting in faster page loading times. I would advise that you read up on output compression before enabling this though.
Simon.
I tested the method above, configuring the .htaccess file to handle HTM files with the PHP parser, and it worked! So far, this is best method I've seen, way better than hacking up a pattern for 301 status errors, since our backlinks can stay intact.
Our company relies heavily on measurements of traffic to our website, most of which comes through the Her Royal Majesty Queen Google. I need to be absolutely certain that we aren't going to be penalized for a "bait-and-switch" - putting new stuff at the same URI where the old stuff used to be.
Can I get comments from anyone who has tried this method, and what it did to your PRs and SERPs?
Cheers,
httpwebwitch
Harbinger.