Redirect dead links to default.aspx

Discussion in 'ASP .Net' started by Frankie, Oct 5, 2005.

  1. Frankie

    Frankie Guest

    I just acquired a new customer who had an existing ASP classic Web site.
    When I took over, I transferred all content to ASPX pages that have
    different page names than the prior Web site had. I kept the original domain
    name. Of course, google and other search engines indexed the old site. So,
    while all links from search results will come to my new ASPX site, the links
    will be dead because of the changed page names (and I'm not about to go with
    the old page names). So, I'd like to have some way for any/all links to the
    site's old page names to result in the visitor being redirected to
    default.aspx instead of receiving the "page not found" error.

    How can I do this?

    Thanks!
     
    Frankie, Oct 5, 2005
    #1
    1. Advertising

  2. Frankie

    rviray Guest

    rviray, Oct 5, 2005
    #2
    1. Advertising

  3. Frankie

    Frankie Guest

    You mean the one specified in Web.config? Yes - I could, but I don't want
    *all* exceptions to result in the user seeing default.aspx. Rather, I want
    them to get default.aspx *only* when they request a page name that no longer
    exists in the site.

    Any ideas for getting that to happen?

    -F





    "rviray" <> wrote in message
    news:...
    >
    > Couldn't you replace the pointer to the Custom Error page that your
    > WebSite references?
    >
    >
    > --
    > rviray
    > ------------------------------------------------------------------------
    > rviray's Profile: http://www.msusenet.com/member.php?userid=4211
    > View this thread: http://www.msusenet.com/t-1871099333
    >
     
    Frankie, Oct 5, 2005
    #3
  4. I have not done this but you might be able to replace the IIS 404 page with
    one of your own. Then you could add some kind of redirect command that will
    push the browser to default.aspx.

    "Frankie" <> wrote in message
    news:...
    > You mean the one specified in Web.config? Yes - I could, but I don't want
    > *all* exceptions to result in the user seeing default.aspx. Rather, I want
    > them to get default.aspx *only* when they request a page name that no
    > longer exists in the site.
    >
    > Any ideas for getting that to happen?
    >
    > -F
    >
    >
    >
    >
    >
    > "rviray" <> wrote in message
    > news:...
    >>
    >> Couldn't you replace the pointer to the Custom Error page that your
    >> WebSite references?
    >>
    >>
    >> --
    >> rviray
    >> ------------------------------------------------------------------------
    >> rviray's Profile: http://www.msusenet.com/member.php?userid=4211
    >> View this thread: http://www.msusenet.com/t-1871099333
    >>

    >
    >
     
    Peter Rilling, Oct 5, 2005
    #4
  5. <customErrors mode="RemoteOnly" defaultRedirect="/error.aspx">
    <error statusCode="403" redirect="/denied.aspx" />
    <error statusCode="404" redirect="/default.aspx" />
    </customErrors>





    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================

    "Frankie" <> wrote in message
    news:...
    > You mean the one specified in Web.config? Yes - I could, but I don't want *all*
    > exceptions to result in the user seeing default.aspx. Rather, I want them to get
    > default.aspx *only* when they request a page name that no longer exists in the site.
    >
    > Any ideas for getting that to happen?
    >
    > -F
    >
    >
    >
    >
    >
    > "rviray" <> wrote in message
    > news:...
    >>
    >> Couldn't you replace the pointer to the Custom Error page that your
    >> WebSite references?
    >>
    >>
    >> --
    >> rviray
    >> ------------------------------------------------------------------------
    >> rviray's Profile: http://www.msusenet.com/member.php?userid=4211
    >> View this thread: http://www.msusenet.com/t-1871099333
    >>

    >
    >
     
    Juan T. Llibre, Oct 5, 2005
    #5
  6. This won't work for his case because he siad that the original pages were
    legacy ASP pages which is not handled by the aspnet_isapi.dll. Therefore,
    IIS will be the one throwing the 404, not ASP.NET.

    "Juan T. Llibre" <> wrote in message
    news:...
    > <customErrors mode="RemoteOnly" defaultRedirect="/error.aspx">
    > <error statusCode="403" redirect="/denied.aspx" />
    > <error statusCode="404" redirect="/default.aspx" />
    > </customErrors>
    >
    >
    >
    >
    >
    > Juan T. Llibre, ASP.NET MVP
    > ASP.NET FAQ : http://asp.net.do/faq/
    > Foros de ASP.NET en Español : http://asp.net.do/foros/
    > ======================================
    >
    > "Frankie" <> wrote in message
    > news:...
    >> You mean the one specified in Web.config? Yes - I could, but I don't want
    >> *all* exceptions to result in the user seeing default.aspx. Rather, I
    >> want them to get default.aspx *only* when they request a page name that
    >> no longer exists in the site.
    >>
    >> Any ideas for getting that to happen?
    >>
    >> -F
    >>
    >>
    >>
    >>
    >>
    >> "rviray" <> wrote in message
    >> news:...
    >>>
    >>> Couldn't you replace the pointer to the Custom Error page that your
    >>> WebSite references?
    >>>
    >>>
    >>> --
    >>> rviray
    >>> ------------------------------------------------------------------------
    >>> rviray's Profile: http://www.msusenet.com/member.php?userid=4211
    >>> View this thread: http://www.msusenet.com/t-1871099333
    >>>

    >>
    >>

    >
    >
     
    Peter Rilling, Oct 5, 2005
    #6
  7. re:
    > This won't work for his case because he said that the original pages were legacy ASP
    > pages which is not handled by the aspnet_isapi.dll. Therefore, IIS will be the one
    > throwing the 404, not ASP.NET.


    Peter,

    *All* his pages are now *.aspx files.

    All he needs to do is map the .asp extension to the aspnet_isapi.dll.
    I assumed that would be obvious. Maybe I shouldn't have.

    Then, if the web.config entries are included as detailed :

    <customErrors mode="RemoteOnly" defaultRedirect="/error.aspx">
    <error statusCode="403" redirect="/denied.aspx" />
    <error statusCode="404" redirect="/default.aspx" />
    </customErrors>

    When a request for any *.asp extension file comes in,
    aspnet_isapi.dll will redirect to default.aspx.

    Thanks for pointing out that I should have included
    the reference to mapping the .asp extension to aspnet_isapi.dll.



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "Peter Rilling" <> wrote in message
    news:...
    > This won't work for his case because he siad that the original pages were legacy ASP
    > pages which is not handled by the aspnet_isapi.dll. Therefore, IIS will be the one
    > throwing the 404, not ASP.NET.


    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> <customErrors mode="RemoteOnly" defaultRedirect="/error.aspx">
    >> <error statusCode="403" redirect="/denied.aspx" />
    >> <error statusCode="404" redirect="/default.aspx" />
    >> </customErrors>
    >>
    >>
    >> Juan T. Llibre, ASP.NET MVP
    >> ASP.NET FAQ : http://asp.net.do/faq/
    >> Foros de ASP.NET en Español : http://asp.net.do/foros/
    >> ======================================
    >>
    >> "Frankie" <> wrote in message
    >> news:...
    >>> You mean the one specified in Web.config? Yes - I could, but I don't want *all*
    >>> exceptions to result in the user seeing default.aspx. Rather, I want them to get
    >>> default.aspx *only* when they request a page name that no longer exists in the site.
    >>>
    >>> Any ideas for getting that to happen?
    >>>
    >>> -F


    >>> "rviray" <> wrote in message
    >>> news:...
    >>>>
    >>>> Couldn't you replace the pointer to the Custom Error page that your
    >>>> WebSite references?
    >>>>
    >>>>
    >>>> --
    >>>> rviray
     
    Juan T. Llibre, Oct 5, 2005
    #7
  8. Frankie

    Frankie Guest

    Yes - perhaps it should have been obvious to *me* too! But it wasn't (kinda
    new to this).

    Thanks all!

    -F


    "Juan T. Llibre" <> wrote in message
    news:...
    > re:
    >> This won't work for his case because he said that the original pages were
    >> legacy ASP pages which is not handled by the aspnet_isapi.dll.
    >> Therefore, IIS will be the one throwing the 404, not ASP.NET.

    >
    > Peter,
    >
    > *All* his pages are now *.aspx files.
    >
    > All he needs to do is map the .asp extension to the aspnet_isapi.dll.
    > I assumed that would be obvious. Maybe I shouldn't have.
    >
    > Then, if the web.config entries are included as detailed :
    >
    > <customErrors mode="RemoteOnly" defaultRedirect="/error.aspx">
    > <error statusCode="403" redirect="/denied.aspx" />
    > <error statusCode="404" redirect="/default.aspx" />
    > </customErrors>
    >
    > When a request for any *.asp extension file comes in,
    > aspnet_isapi.dll will redirect to default.aspx.
    >
    > Thanks for pointing out that I should have included
    > the reference to mapping the .asp extension to aspnet_isapi.dll.
    >
    >
    >
    > Juan T. Llibre, ASP.NET MVP
    > ASP.NET FAQ : http://asp.net.do/faq/
    > Foros de ASP.NET en Español : http://asp.net.do/foros/
    > ======================================
    > "Peter Rilling" <> wrote in message
    > news:...
    >> This won't work for his case because he siad that the original pages were
    >> legacy ASP pages which is not handled by the aspnet_isapi.dll.
    >> Therefore, IIS will be the one throwing the 404, not ASP.NET.

    >
    >> "Juan T. Llibre" <> wrote in message
    >> news:...
    >>> <customErrors mode="RemoteOnly" defaultRedirect="/error.aspx">
    >>> <error statusCode="403" redirect="/denied.aspx" />
    >>> <error statusCode="404" redirect="/default.aspx" />
    >>> </customErrors>
    >>>
    >>>
    >>> Juan T. Llibre, ASP.NET MVP
    >>> ASP.NET FAQ : http://asp.net.do/faq/
    >>> Foros de ASP.NET en Español : http://asp.net.do/foros/
    >>> ======================================
    >>>
    >>> "Frankie" <> wrote in message
    >>> news:...
    >>>> You mean the one specified in Web.config? Yes - I could, but I don't
    >>>> want *all* exceptions to result in the user seeing default.aspx.
    >>>> Rather, I want them to get default.aspx *only* when they request a page
    >>>> name that no longer exists in the site.
    >>>>
    >>>> Any ideas for getting that to happen?
    >>>>
    >>>> -F

    >
    >>>> "rviray" <> wrote in message
    >>>> news:...
    >>>>>
    >>>>> Couldn't you replace the pointer to the Custom Error page that your
    >>>>> WebSite references?
    >>>>>
    >>>>>
    >>>>> --
    >>>>> rviray

    >
    >
     
    Frankie, Oct 6, 2005
    #8
    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. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,358
    Srowe1975
    Oct 15, 2008
  2. =?Utf-8?B?TWlsYW5C?=

    HttpHandler to Redirect root Default.aspx

    =?Utf-8?B?TWlsYW5C?=, Mar 8, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    4,038
    =?Utf-8?B?TWlsYW5C?=
    Mar 9, 2006
  3. K.S.Sreeram

    daily python url - gmane links dead?

    K.S.Sreeram, Jun 13, 2006, in forum: Python
    Replies:
    0
    Views:
    277
    K.S.Sreeram
    Jun 13, 2006
  4. Sal
    Replies:
    1
    Views:
    995
  5. dany

    check for dead links

    dany, Jul 10, 2003, in forum: ASP General
    Replies:
    1
    Views:
    130
    Aaron Bertrand - MVP
    Jul 10, 2003
Loading...

Share This Page