Page is a not externally linkable
jd01 - 7:04 pm on Sep 25, 2007 (gmt 0)
Thanks. codeman: Means not all URLs were redirected... # If someone requests example.com send them to www.example.com # If someone requests page.html send them to newpage.html In the above example if someone requests http://example.com/page.html there will be two redirects. When the request is made the 'host' will not be www.example.com, so the first rule will redirect the visitor to www.example.com/page.html, then when page.html is requested the second rule will redirect page.html to newpage.html... There will be two redirects. One way to help solve the problem is to make sure you redirect in the most efficient order. By changing the order of the rules and redirecting the page request first, you correct the host issue at the same time, so the ruleset below would only result in one redirect with same request from a visitor. # If someone requests page.html send them to newpage.html # If someone requests example.com send them to www.example.com This is just a simple example... from there it gets more complicated. PageOne: Justin
guru5571:
Glad things are working for you. Put 301 redirects on a few key URL's, and allow the rest to go 404.
Only the main pages were redirected and the rest were removed.
I'm guessing some pages were not redirected because there was not an 'equivalent' page to redirect to. Make sure that only one redirect occurs with each request.
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^page\.html$ http://www.example.com/newpage.html [R=301,L]
RewriteRule ^page\.html$ http://www.example.com/newpage.html [R=301,L]
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
301, always, unless it is only a temporary redirect, then I use a 307 (or 302).