views:

118

answers:

1

I've made the change from querystring asp.net webforms application to an url routing one. Now I'm trying to let google know that there's a new set of urls to be aware of. The G has indexed 133 out of 179 new urls sent in sitemap.xml, but the site:mistral.hr command returns the old querystring version of the links. This could partly be so because I left the functionality of the old querystring version of the site(for backwards compatibility), and haven't done any 301 redirects(nor do I know how to achieve them in my shared hosting account). The old querystring and the new url routing both point to the same Default.aspx page.

+3  A: 

I assume what you want, is to remove the "dead" links from the Google results. Here are three solutions that should work:

  1. Add a rule in robots.txt that disallows access to the old URL. Assuming that the old URLs contained Default.aspx explicitly, and your new ones are accessible without this qualifier, the following should get the job done:

    User-Agent: *
    Disallow: /Default.aspx
    
  2. Return 301 Moved Permanently from the old URLs, with a Location pointing to the new. Using ASP.NET and C#, this would be something like this:

    Response.Status = "301 Moved Permanently";
    Response.AppendHeader("Location", "http://example.com/newurl");
    
  3. Return 410 Gone from any request to the old URLs:

    Response.Status = "410 Gone";
    

You should not need anything special from your host to do any of the two latter. Simply leave the page that used to handle the old URLs around, and replace the logic in the Page_Load handler with either the 301 or 410 code from above.

Whichever one you pick, allow Google (and others) some days/weeks/months to adjust to the new setup. You should start to see a decrease in the number of old URLs in the index pretty soon, but it might take a long time before they are all gone.

Jørn Schou-Rode
Will there be a seo penalty for redirection from the homepage(Default.aspx)?
vani
As long as you only do a *single* redirect using `301`, it is my impression that the major search engines simply "follow the redirect", migrating PageRank or similar to the new URL. But really, this is a seperate question, and I am not sure if I am the correct person to answer it.
Jørn Schou-Rode