Copied to clipboard

Flag this post as spam?

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


  • Paul Nerie 10 posts 72 karma points
    Mar 04, 2016 @ 11:20
    Paul Nerie
    0

    Custom 404 handling URL's with file extension

    Hi,

    We have an issue with redirecting to our custom 404 page when the url has file extensions.

    URL's like this would work: http://www.mysite.com/nonexistentpage

    But not with file extensions: http://www.mysite.com/somefolder/nonexistentfile.ext http://www.mysite.com/nonexistentfile.ext

    It just goes to default Umbraco 404 page.

    Can we handle this kind of 404 scenario?

    Thanks in advance!

    Regards, Paul

  • Kasper Holm 47 posts 180 karma points
    Mar 04, 2016 @ 14:44
    Kasper Holm
    0

    Hello Paul

    have you added the path to the umbracoReservedUrls tag the web.config ?

  • Paul Nerie 10 posts 72 karma points
    Mar 05, 2016 @ 02:14
    Paul Nerie
    1

    Hi Kasper,

    Thanks for the reply.

    I found this forum post: https://our.umbraco.org/forum/ourumb-dev-forum/bugs/50332-Custom-404-Only-Works-for-Extensionless-and-ASPX-URLs

    And this solution worked:

    <httpErrors errorMode="Custom">
        <remove statusCode="404" />
        <error statusCode="404" path="/arbitraryPathThatDoesNotExistAndThatWillRespondWithA404" responseMode="ExecuteURL" />
    </httpErrors>
    

    Regards, Paul

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies