404 pages

Discussion in 'ASP .Net' started by lee atkinson, Mar 22, 2009.

  1. lee atkinson

    lee atkinson Guest

    Hi Guys

    Got a problem with the custom 404 error redirect functionality...

    Got this in the web.config -

    <customErrors mode="On">
    <error statusCode="404" redirect="~/404.aspx" />
    </customErrors>


    Only seems to work if you spell a page incorrectly eg -

    Blah.com/indexxxx.aspx

    Doesn't work if you have this - (no page extensions)

    Blah.com/sdsdsdsd/ssss

    Anybody got a workaround for this ? ... A workaround that doesn¹t involve
    tampering with IIS too

    Lee
    lee atkinson, Mar 22, 2009
    #1
    1. Advertising

  2. lee atkinson

    lee atkinson Guest

    Re: 404 pages - no answer

    I never seem to get an answers for the tricky ones? You 'MVP's seem only to
    have smart alex answers for the obvious ones..

    L


    On 22/03/2009 12:52, in article C5EBE503.3F28%,
    "lee atkinson" <> wrote:

    > Hi Guys
    >
    > Got a problem with the custom 404 error redirect functionality...
    >
    > Got this in the web.config -
    >
    > <customErrors mode="On">
    > <error statusCode="404" redirect="~/404.aspx" />
    > </customErrors>
    >
    >
    > Only seems to work if you spell a page incorrectly eg -
    >
    > Blah.com/indexxxx.aspx
    >
    > Doesn't work if you have this - (no page extensions)
    >
    > Blah.com/sdsdsdsd/ssss
    >
    > Anybody got a workaround for this ? ... A workaround that doesn¹t involve
    > tampering with IIS too
    >
    > Lee
    >
    lee atkinson, Mar 23, 2009
    #2
    1. Advertising

  3. lee atkinson

    Lloyd Sheen Guest

    Re: 404 pages - no answer

    "lee atkinson" <> wrote in message
    news:C5ED4D91.3F98%...
    >I never seem to get an answers for the tricky ones? You 'MVP's seem only to
    > have smart alex answers for the obvious ones..
    >
    > L
    >
    >
    > On 22/03/2009 12:52, in article C5EBE503.3F28%,
    > "lee atkinson" <> wrote:
    >
    >> Hi Guys
    >>
    >> Got a problem with the custom 404 error redirect functionality...
    >>
    >> Got this in the web.config -
    >>
    >> <customErrors mode="On">
    >> <error statusCode="404" redirect="~/404.aspx" />
    >> </customErrors>
    >>
    >>
    >> Only seems to work if you spell a page incorrectly eg -
    >>
    >> Blah.com/indexxxx.aspx
    >>
    >> Doesn't work if you have this - (no page extensions)
    >>
    >> Blah.com/sdsdsdsd/ssss
    >>
    >> Anybody got a workaround for this ? ... A workaround that doesn¹t involve
    >> tampering with IIS too
    >>
    >> Lee
    >>

    >


    Hey Lee,

    For someone who is looking for help from those "You 'MVP's seem only to
    have smart alex answers for the obvious ones.." you are pretty disrespectful
    and I would expect no answer from them.

    I don't often reply like this but I and many others have been helped
    many times so I feel it necessary to defend this forum as an excellent
    method of finding solutions to problems. I can only suggest an apology or I
    cannot see anyone helping someone who holds his helpers in such low regard.

    LS
    Lloyd Sheen, Mar 23, 2009
    #3
  4. Re: 404 pages - no answer

    re:
    !> You 'MVP's seem only to have smart alex answers for the obvious ones...

    Isn't that just a tad unfair ?
    Advice: it's easier to catch answers by posting honey that by posting vinegar.

    Here's an article that shows you how to do what you want to do :

    http://msmvps.com/blogs/omar/archiv...g-isapi-module-or-iis-6-wildcard-mapping.aspx

    All you have to do is forward all HTTP 404 to ASP.NET.

    To forward HTTP 404 to ASP.NET ISAPI, you need to
    configure IIS to redirect to some .aspx extension on HTTP 404.

    Then, in global.asax's BeginRequest event, capture the URL and check
    whether it's an extensionless URL request ( see the article's code ).

    If it is, URLrewrite the extensionless URL.

    Notice that the example simply adds the .aspx extension to the extensionless URL :

    HttpContext.Current.RewritePath(requestedFile + ".aspx?" + queryString);

    You'll need to rewrite to a custom error page which lets the user know that extensionless requests aren't allowed.

    ....and please make your requests in a nicer way from now on,. OK ?




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    =========================
    "lee atkinson" <> wrote in message news:C5ED4D91.3F98%...
    >I never seem to get an answers for the tricky ones? You 'MVP's seem only to
    > have smart alex answers for the obvious ones..
    >
    > L
    >
    >
    > On 22/03/2009 12:52, in article C5EBE503.3F28%,
    > "lee atkinson" <> wrote:
    >
    >> Hi Guys
    >>
    >> Got a problem with the custom 404 error redirect functionality...
    >>
    >> Got this in the web.config -
    >>
    >> <customErrors mode="On">
    >> <error statusCode="404" redirect="~/404.aspx" />
    >> </customErrors>
    >>
    >>
    >> Only seems to work if you spell a page incorrectly eg -
    >>
    >> Blah.com/indexxxx.aspx
    >>
    >> Doesn't work if you have this - (no page extensions)
    >>
    >> Blah.com/sdsdsdsd/ssss
    >>
    >> Anybody got a workaround for this ? ... A workaround that doesn¹t involve
    >> tampering with IIS too
    >>
    >> Lee
    >>

    >
    Juan T. Llibre, Mar 23, 2009
    #4
  5. Re: 404 pages - no answer

    re:
    !> I don't often reply like this but I and many others have been helped
    !> many times so I feel it necessary to defend this forum as an excellent
    !> method of finding solutions to problems. I can only suggest an apology
    !> or I cannot see anyone helping someone who holds his helpers in such low regard.

    Thanks, Lloyd.

    I made a similar comment...and was tempted not to give him the answer he asked for,
    but my good samaritan spirit overpowered me...and I gave him his answer.

    I agree that he was out of line and that's it's easier to catch flies with honey than with vinegar.

    The concept of "peers helping peers" needs to be understood a bit more by people like Lee.

    Nobody ( that includes MVPs and non-MVPs ) gets paid for helping users here.

    We all do it because we passionately believe in helping others.
    Being nice in return would seem to be only fair play.




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    =========================
    "Lloyd Sheen" <> wrote in message news:...
    >
    > "lee atkinson" <> wrote in message news:C5ED4D91.3F98%...
    >>I never seem to get an answers for the tricky ones? You 'MVP's seem only to
    >> have smart alex answers for the obvious ones..
    >>
    >> L
    >>
    >>
    >> On 22/03/2009 12:52, in article C5EBE503.3F28%,
    >> "lee atkinson" <> wrote:
    >>
    >>> Hi Guys
    >>>
    >>> Got a problem with the custom 404 error redirect functionality...
    >>>
    >>> Got this in the web.config -
    >>>
    >>> <customErrors mode="On">
    >>> <error statusCode="404" redirect="~/404.aspx" />
    >>> </customErrors>
    >>>
    >>>
    >>> Only seems to work if you spell a page incorrectly eg -
    >>>
    >>> Blah.com/indexxxx.aspx
    >>>
    >>> Doesn't work if you have this - (no page extensions)
    >>>
    >>> Blah.com/sdsdsdsd/ssss
    >>>
    >>> Anybody got a workaround for this ? ... A workaround that doesn¹t involve
    >>> tampering with IIS too
    >>>
    >>> Lee
    >>>

    >>

    >
    > Hey Lee,
    >
    > For someone who is looking for help from those "You 'MVP's seem only to have smart alex answers for the obvious
    > ones.." you are pretty disrespectful and I would expect no answer from them.
    >
    > I don't often reply like this but I and many others have been helped many times so I feel it necessary to defend
    > this forum as an excellent method of finding solutions to problems. I can only suggest an apology or I cannot see
    > anyone helping someone who holds his helpers in such low regard.
    >
    > LS
    Juan T. Llibre, Mar 23, 2009
    #5
    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. Matthew Louden
    Replies:
    4
    Views:
    4,015
    Guest
    Nov 8, 2003
  2. Matthew Louden
    Replies:
    0
    Views:
    557
    Matthew Louden
    Dec 3, 2003
  3. Matthew Louden

    HTTP 404 Error for ASP.NET pages

    Matthew Louden, Dec 4, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    6,308
    Matthew Louden
    Dec 4, 2003
  4. Jonathan Folland
    Replies:
    2
    Views:
    1,622
    Jonathan Folland
    Mar 17, 2005
  5. Mike Baroukh

    Manage 404 pages with a servlet

    Mike Baroukh, Feb 26, 2004, in forum: Java
    Replies:
    3
    Views:
    391
    Mike Baroukh
    Mar 1, 2004
Loading...

Share This Page