views:

190

answers:

6

Hello all,

I run a small e-commerce site that over the last few years has built up a reasonable search engine status.

I've been working on a new site that uses new URL formats and I am worried about how to deal with all the broken links and customer frustration for users finding out dated links through search engines.

Can anyone offer advice on how to mitigate / minimize the damage? The old site was done in ASP.NET the new in ASP.NET MVC

Thanks for any help you can be.

+1  A: 

You could set up your old site's .htaccess file to redirect traffic to the new site. Beyond that, you could use mod_rewrite to map requests to pages on the old site to the same (or similar) pages on the new one.

Evan Meagher
asp site, mode_rewrite wont actually help here.
Goblyn27
Thanks. I've never used ASP, so I didn't know that factoid.
Evan Meagher
+2  A: 

You should create permanent redirects for the links you want to preserve (routelevel). This way searchengines will update their references to the new locations.

Ropstah
+4  A: 

You will need some sort of parallel structure. Ideally, the old site with the old URLs remains fully accessible for some time, but does not get indexed any more. If that's not feasible, and since you are saying that the site is small, you could establish a URL mapping old-new and have a 404 handler that attempts to redirect to the new content.

cdonner
Thanks for your help. Spent some time on it today and it doesn't look as bad as it did at midnight last night!!!Cheers for the suggestion. Going with pretty much what you said
Remmus
You cannot invalidate a URL with 404 and redirect it at the same time. But you can invalidate a URL by redirecting with 301 to the new one.
Gumbo
Cheers Gumbo, I was lucky in that the none of my urls were caught by my new routing and so my catch all route, that was just used to display a return a 404 error could be used.What I do now is when a request is sent in, I look for a match in an xml file, if one is found i redirect with a 301 to the new url. If no match is found I return a 404, page not found.
Remmus
+2  A: 

As cdonner says, you want to have a handler that reroutes the traffic to its appropriate destination. Even more important though, is you want to make sure when you redirect the client, you send a status code of 301 (permanently moved) instead of 404. The search engines will rate you negatively if there are a lot of 404 errors on your site and you will see your standing decrease instead of increase.

Goblyn27
A: 

Sounds like you have it figured out, but just wanted to add one more option - the canonical tag - which may have advantages if for any reason you needed to keep both the old url and the new URL active. You can create a copy of the page at the old URL and then add the "canonical" tag, which tells the search engines "please credit the link credits of this page to the following page: www.site.com/newpage"

<link rel="canonical" href="http://www.yoursite.com" /> this line goes in before </head>

For example if you have lots of links to certain key pages and those links are pointed to the old URL's, this may be a help.

A 301 also redirects the link credits, and generally moved pages you'll want to use a 301 redirect. Oh and if you use a URL rewrite rule and all the URL's change in the same way, you can probably use regex in the rewrite rule to handle all of them in a single step.

Qualsmith
very interesting, never new that, but could well come in handy in the future. Thanks for the information.
Remmus
+1  A: 

This is the way I do it migrating from an old ASP classic site:

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim fullOriginalpath As String = Request.Url.ToString.ToLower

    If (fullOriginalpath.Contains("/viewitem.asp?itemid=")) Then
        Context.Response.StatusCode = 301
        Context.Response.Redirect("/item/" + getItemIDFromPath(fullOriginalpath))
    ElseIf (fullOriginalpath.Contains("/search.asp")) Then
        Context.Response.StatusCode = 301
        Context.Response.Redirect("/search/")
    ElseIf (fullOriginalpath.EndsWith("/default.asp")) Then
        Context.Response.StatusCode = 301
        Context.Response.Redirect("/")
    End If
End Sub
Eduardo Molteni