Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • anthony hall 222 posts 536 karma points
    Jun 08, 2017 @ 09:34
    anthony hall
    0

    404 pages not working on long querystrings

    I have set the id in umbracosettings to my "page not found" node.

    So the following correct returns page not found

    www.mysite.local/somepagethatdoesnotexists
    

    However... if i enter an insanely long querystring the famous "This page is intentionally left ugly ;-)" is returned.

    www.mysite.local/search/?keyword=lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum
    

    I have the following in my web.config.

    <customErrors defaultRedirect="~/errorpage.aspx?" mode="Off" redirectMode="ResponseRewrite">
      <error redirect="/errorpage.aspx" statusCode="500" />
    </customErrors>
    

    and

     <httpErrors existingResponse="PassThrough" />
    
  • Manish 373 posts 932 karma points
    Jun 08, 2017 @ 10:09
    Manish
    1

    Well it is good to use _404iLastChanceFinder

    Here is link to set up

    Link 1

    and Link 2

  • anthony hall 222 posts 536 karma points
    Jun 13, 2017 @ 08:23
    anthony hall
    0

    Thanks Manish, Interesting approach ( using IContentFinder ). However when I have really long querystring the handler is not evoked. It goes straight to "This page is intentionally left ugly".

  • Michael Latouche 504 posts 819 karma points MVP 3x c-trib
    Jun 13, 2017 @ 11:47
    Michael Latouche
    1

    Hi Anthony,

    This might indicate that somehow, very long query strings are actually blocked at IIS level without even entering your application. Could it be that somewhere in your web.config (or at machine.config for that matter) you have a maximum allowed request length specified that is lower than your "very long query string" length?

    In your web.config it would look like something like this:

    <configuration>
        <system.web>
            <httpRuntime maxRequestLength="1048576" />
        </system.web>
    </configuration>
    

    Hope this helps...

    Cheers,

    Michael.

  • anthony hall 222 posts 536 karma points
    Jun 13, 2017 @ 13:16
    anthony hall
    0

    Thanks Michael, increasing this value enables the 404 page i specified in my umbraco.settings.

  • Michael Latouche 504 posts 819 karma points MVP 3x c-trib
    Jun 13, 2017 @ 23:15
    Michael Latouche
    0

    Great!

Please Sign in or register to post replies

Write your reply to:

Draft