Migrating static site to ASP.NET - How to handle redirecting old URLs?

Discussion in 'ASP .Net' started by ITistic, Jun 12, 2007.

  1. ITistic

    ITistic Guest

    I am about to start on a migration from a static HTML site to an
    ASP.NET solution. I've done a ton of these in the past as my primary
    job duty is developing ASP.NET sites. This is the first project I've
    come across for a site that has quite a few .HTM pages with good
    search engine ranking. I want to make sure I do everything I can to
    retain those rankings at least as far as the URLs are concerned. What
    I want to do is make sure that when an old .HTM URL is requested that
    the system 301 redirects to the equivalent ASP.NET page. My initial
    thought is to create a database table of all the OLD virtual URLs
    (ex: /products/product1/index.htm) and the new ASP.NET URL that they
    should be redirected to. I could then set ASP.NET to process .HTM
    pages and use a custom 404 handler to perform the redirection. Is this
    the best way? Even if you think it is, what other solutions have you
    used that may be easier or better?
     
    ITistic, Jun 12, 2007
    #1
    1. Advertising

  2. ITistic

    RSH Guest

    I have used redirects in IIS as well as custom redirects in the Global.asax
    file basically error trapping the page not found error and forwarding them
    to the new page.

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

    strErr = Server.GetLastError.ToString()

    If InStr(strErr, "System.IO.FileNotFoundException:") > 0 Then

    If InStr(UCase(strErr), "\SERVICES\") > 0 Then

    Response.Redirect("/EmployerSolutions_Main.aspx")

    ElseIf InStr(UCase(strErr), UCase("\About\")) > 0 Then

    Response.Redirect("/About.aspx")

    ElseIf InStr(UCase(strErr), UCase("\Accountants\")) > 0 Then

    Response.Redirect("/IndustrySolutions_AccountingProfessionals.aspx")

    End Sub



    "ITistic" <> wrote in message
    news:...
    >I am about to start on a migration from a static HTML site to an
    > ASP.NET solution. I've done a ton of these in the past as my primary
    > job duty is developing ASP.NET sites. This is the first project I've
    > come across for a site that has quite a few .HTM pages with good
    > search engine ranking. I want to make sure I do everything I can to
    > retain those rankings at least as far as the URLs are concerned. What
    > I want to do is make sure that when an old .HTM URL is requested that
    > the system 301 redirects to the equivalent ASP.NET page. My initial
    > thought is to create a database table of all the OLD virtual URLs
    > (ex: /products/product1/index.htm) and the new ASP.NET URL that they
    > should be redirected to. I could then set ASP.NET to process .HTM
    > pages and use a custom 404 handler to perform the redirection. Is this
    > the best way? Even if you think it is, what other solutions have you
    > used that may be easier or better?
    >
     
    RSH, Jun 12, 2007
    #2
    1. Advertising

  3. ITistic

    bruce barker Guest

    Re: Migrating static site to ASP.NET - How to handle redirectingold URLs?

    just map .htm to asp.net and keep the same file names. there is nothing
    really special about using .aspx, it just a convention

    -- bruce (sqlwork.com)


    ITistic wrote:
    > I am about to start on a migration from a static HTML site to an
    > ASP.NET solution. I've done a ton of these in the past as my primary
    > job duty is developing ASP.NET sites. This is the first project I've
    > come across for a site that has quite a few .HTM pages with good
    > search engine ranking. I want to make sure I do everything I can to
    > retain those rankings at least as far as the URLs are concerned. What
    > I want to do is make sure that when an old .HTM URL is requested that
    > the system 301 redirects to the equivalent ASP.NET page. My initial
    > thought is to create a database table of all the OLD virtual URLs
    > (ex: /products/product1/index.htm) and the new ASP.NET URL that they
    > should be redirected to. I could then set ASP.NET to process .HTM
    > pages and use a custom 404 handler to perform the redirection. Is this
    > the best way? Even if you think it is, what other solutions have you
    > used that may be easier or better?
    >
     
    bruce barker, Jun 12, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kaidi
    Replies:
    5
    Views:
    493
    Andrew Thompson
    Jan 4, 2004
  2. Jim Hill
    Replies:
    3
    Views:
    417
    Jim Hill
    Feb 12, 2007
  3. Nathan Sokalski

    Converting Relative URLs into Absolute URLs

    Nathan Sokalski, Aug 11, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    764
    Sriram Srivatsan
    Aug 12, 2008
  4. Adam Monsen

    JDBC URLs ...not really URLs?

    Adam Monsen, Feb 6, 2009, in forum: Java
    Replies:
    11
    Views:
    6,335
    Adam Monsen
    Feb 8, 2009
  5. Steve T.

    dynamic URLS convert to static URLS for search engines

    Steve T., Mar 1, 2004, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    311
    Steve T.
    Mar 4, 2004
Loading...

Share This Page