Forum Moderators: phranque
the new page is in fact in .PHP (example.php) which i rewrite to .HTML (example.html)
# Redirect old .html request to new .html URL (and strip parameters)
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*old-page-example\.html(\?[^\ ]*)? HTTP/
RewriteRule ^([^/]*/)*old-page-example\.html http://www.example.com/new-page-example.html? [R=301,L]
# Redirect external .php request to new .html URL (and strip parameters)
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*new-page-example\.php(\?[^\ ]*)? HTTP/
RewriteRule ^([^/]*/)*new-page-example\.php http://www.example.com/new-page-example.html? [R=301,L]
# Redirect non-www to www
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
# Rewrite .html request to fetch the .php file.
RewriteRule ^new-page-example.html /new-page-example.php [L]