Page is a not externally linkable
g1smd - 12:11 am on Jul 30, 2012 (gmt 0)
You need a copy of the code, in order to review it.
Let's say your old server (example.net) had this old code (27, 28, 29):
# 27 - Redirect index requests
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index(\.(php|html?))?
RewriteRule ^(([^/]+/)*)index(\.(php|html?))?$ http://www.example.net/$1? [R=301,L]
# 28 - Redirect .php requests to extensionless URL
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*[^/.]+)\.php
RewriteRule ^(([^/]+/)*[^/.]+)\.php$ http://www.example.net/$1? [R=301,L]
# 29 - Redirect non-canonical requests to www
RewriteCond %{HTTP_HOST} !^(www\.example\.net)?$
RewriteRule (.*) http://www.example.net/$1 [R=301,L]
Some people would be tempted to just add this code (30) on the end of those three rules or in place of those three rules:
# 30 - Redirect to new site
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
to redirect to the new server (example.com).
That would be a mistake as it would introduce a multiple step redirection chain.
You'd need to instead alter the above rules (27, 28, 29) on the old server (example.net) to directly point all of these requests to the correct URL on the new server (example.com).
# 27 - Redirect index requests to new site, correcting path within the redirect
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index(\.(php|html?))?
RewriteRule ^(([^/]+/)*)index(\.(php|html?))?$ http://www.example.com/$1? [R=301,L]
# 28 - Redirect .php requests to extensionless URL on new site
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*[^/.]+)\.php
RewriteRule ^(([^/]+/)*[^/.]+)\.php$ http://www.example.com/$1? [R=301,L]
# 30 - Redirect all other requests to www on new site
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
as well as add these rules (31, 32, 33) on the new site (example.com):
# 31 - Redirect index requests on new server
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index(\.(php|html?))?
RewriteRule ^(([^/]+/)*)index(\.(php|html?))?$ http://www.example.com/$1? [R=301,L]
# 32 - Redirect .php requests to extensionless URL
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*[^/.]+)\.php
RewriteRule ^(([^/]+/)*[^/.]+)\.php$ http://www.example.com/$1? [R=301,L]
# 33 - Redirect non-canonical requests to www
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]