Forum Moderators: Robert Charlton & goodroi
Unlike the "Rewrite" fix detailed in:
[webmasterworld.com...]
I do not need to Rewrite anything.
My concern is the 404's for all URLs that had underscores (coming from Google searches).
e.g.-
www.example.com/info/test_dir/my_dog_has_fleas.htm
is now:
www.example.com/info/test-dir/my-dog-has-fleas.htm
I'm looking for opinions...
Would you:
A). Leave it all alone and wait for Google to reindex the site.
B). Put a Redirect in .htaccess with a regular expression to translate all underscores in URLs to hyphens. (For now, I've put a generic 404 that sends all "underscore traffic" to the home page)..
C). Do something else ?
[edited by: tedster at 2:28 am (utc) on July 6, 2008]
[edit reason] moved from another location [/edit]
In this case, you should use a 301 redirect from the old URLs to the new URLs. That retains traffic coming from *everywhere* that is requesting the old URLs. It also signifies to Google and other sites to update the URLs found.
In this case, you should use a 301 redirect from the old URLs to the new URLs. That retains traffic coming from *everywhere* that is requesting the old URLs. It also signifies to Google and other sites to update the URLs found.
The home page 404 was a quick and dirty approach, (98% of the site were these underscore URLs).
Does the limitation on number of hyphens under Apache Rewrite apply to Redirects?
I'm rusty on my regular expressions in .htaccess...
Anyone wanna throw me a 301 rule that means: redirect all traffic for URLs like:
/news/this_is_a_dir/this_is_a_file.htm
/info/this_is_a_dir/this_is_a_file.htm
to:
/news/this-is-a-dir/this-is-a-file.htm
/info/this-is-a-dir/this-is-a-file.htm
All are files and subdirectories of www.example.com/news/ and www.example.com/info/
TIA
[edited by: tedster at 2:38 am (utc) on July 6, 2008]
[edit reason] moved from another location [/edit]
A 404 error should return a custom 404 page with relevant error message
Make sure that the HTTP header response is NOT 200 - or Google will index the page.
I read a post to this effect here recently and also saw it in effect on a new site I've just taken on. They have hundreds of 'custom 404' pages indexed.
301 is best. If not then Google will eventually drop 404s from their index but this can take a long time. If there are any links to the internal pages you are wasting them and I believe this means the 404 will hang around for longer.
I know jdMorgan keeps the above in tip top shape and I do believe all the code you are looking for are in those referenced tutorials. He's got them pretty well organized so I think you'll find what you are looking for fairly quickly. If not, this might be best served in the Apache Forum.
404s?
Those things will last forever if there are links out there referencing the old URIs. Once you put the 301 in place, you'll never remove it. If you do, the 404s will come back. Yahoo! Slurp and MSNbot will make sure of that. So will Googlebot!