Forum Moderators: phranque
RewriteRule ^index\.htm$ index.php [R=301,L]
RewriteRule ^aboutus\.htm$ aboutus.php [R=301,L]
It's working fine but, I am concerned about the SEs. Don't want to get penalized for dupe content or anything. Is the above correct?
Thanks!
I got the problem fixed. I was not specifying the full URL, it should be:
RewriteRule ^index\.htm$ [mysite.com...] [R=301,L]
Not
RewriteRule ^index\.htm$ index.php [R=301,L]
RewriteRule ^index\.htm$ http://www.example.com/index.php [R=301,L]
RewriteRule ^aboutus\.htm$ http://www.example.com/aboutus.php [R=301,L]
RewriteRule ^([^.]+)\.htm$ http://www.example.com/$1.php [R=301,L]
Important: Flush your browser cache after *any* change to your .htaccess code.
As jamie says, it's often easier to just leave the URLs alone and have the server parse .html files as .php. Since the output from a PHP page is HTML, this is an entirely acceptable thing to do, and your URLs don't have to change.
Jim