I have recently updated a website. All of the urls have changed. Now I get traffic to old urls that doesn't exist anymore. However, most of these url's have corresponding pages on the new site.
I believe most of the traffic to the old urls are spiders.
What would be the correct w开发者_开发知识库ay to handle this?
Preferably I'd like a solution that gives a nice experience for the real users if they type in an old url (or use an old bookmark they've made) but that also notifies the spiders of the change of url, so that they can update their registers. However, if the two are hard to combine, the last one is prioritized (since most of the traffic is spiders).
I'm using ASP.NET
You could use URL rewriting of some sort. Scott Gu has written a nice article about it here.
You should make your server return a "301 Moved permanently" error, with the new location for the data. How this is done best depends on your application.
Best guess is that you have a table with records of old locations and their new locations, and in your error handling you check if the requested location is in the table, and in that case you return a 301 with the new location, otherwise you return a 404.
精彩评论