I have an existing site A I want to redirect to existing site B, in order to consolidate my content, since they are both on the same theme. I know how to do a straight 301 redirect. What is making me a little gunshy is the fact that exisitng site A has a 301 redirect in place at the moment which I added in order to transition from .html pages to .php pages, like so: What would be the best way to handle this in order to keep the html to php, but also to redirect to Site B? 1) .html site A -> .php site A -> .php site B 2) .html site A -> .php site B 3) .html site A -> .html Site B + .html site A-> .php Site B 4) something else? Any ideas?
The best way is add a file handler so your .htaccess file, that way does not really care if site A or site B is either php or html because both extensions will be parsed as PHP AddHandler application/x-httpd-php .html .htm .php Code (markup):
Don't use that. It tells your server to treat those extensions as PHP files. Now every time a .HTML file is requested, instead of simply being sent straight back to the user, it must first be parsed through the PHP engine - even if its just a plain html file. The performance hit this has will depend on both your server and the amount of traffic. You could probably get away with it but it's not a very good practice. You were along the right lines with mod_rewrite. The best solution would not involve sending more than one redirect header, so in the htaccess for Site A: Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)\.html $1.php RewriteRule ^(.*)$ http://www.siteB.com/$1.php [R=301,L] Code (markup): If its a .html, we first rewrite to .php internally (without redirecting). Then we redirect everything to the new domain. In theory, there should not be any links to a .html site B page if its a new domain. The inlinks to .html site A pages have already been sorted to redirect straight to site B .php, so you shouldn't need any redirects on site B.