was wondering if someone knew how to change .php to .html through a mod rewrite as we want to change the site to .php but keep all the cached pages as .html Anything simple would be best. Don't want to have to start over with .php pages in the SERPS.
Why not code the pages in php but keep them all with the html extension? RewriteRule ^(.*)\.html$ $1.php [L]
We use this for *.phtml pages: RewriteEngine on RewriteRule ^(.*)\.html$ $1 [C,E=WasHTML:yes] # rewrite to document.phtml if exists RewriteCond %{REQUEST_FILENAME}.phtml -f RewriteRule ^(.*)$ $1.phtml [S=1] # else reverse the previous basename cutout RewriteCond %{ENV:WasHTML} ^yes$ RewriteRule ^(.*)$ $1.html Code (markup): This allows us to keep the pages as *.phtml locally, but show *.html to the world.