I need to switch a site over and many url's have changed. I also want all pages to redirect to the www. version of the page. Will the following code work or do I need to do something else? RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com RewriteRule (.*) http://www.example.com/$1 [R=301,L] Redirect 301 /contact.html http://www.example.com/contact.php Redirect 301 /links/websitetools.html http://www.example.com/links/website-tools.php PHP:
Anyone know how to fix this file? Firefox is saying it is redirecting in a way that will never complete.
Rather than redirect all of your pages, keep them. Instead you can instruct the Server to process .html files as php scripts. Instructions can be found on this DP thread: .htaccess, AddType application/x-httpd-php .php .htm .html
I am a little confused by that. I am not quite sure how it can help since the site has a bunch of .html pages that are being moved to different locations along with changing to .php
All I was saying, is to keep the .html extension without redirects. You can still process an .html page as PHP. An extensive redirect list in .htaccess can put more strain on the server. And you will have to maintain the list if there any external links pointing to those pages.