Copied to clipboard

Flag this post as spam?

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


  • Martina R 9 posts 90 karma points
    Jan 22, 2020 @ 10:42
    Martina R
    0

    Umbraco 7 - Custom 404 page: problems with missing images and urls that contain a dot '.'

    Hello,

    I'm having a problem that is quite widespread from what I can see after a "quick survey" of big online umbraco websites:

    I've created a custom 404 page and I've implemented a custom IContentFinder for a multilingual website => the custom 404 page works well except in 3 (2) cases:

    1) www.mydomain.com/hello. <= notice the dot '.' at the end.

    404<em>server</em>error

    2-3) www.mydomain.com/my-missing-image.jpg or any url that contains a dot '.' like www.mydomain.com/hello.hello

    ugly_404

    At the moment I'm using a temporary fix thanks to SEO-Checker 404 settings (SEO-Checker => Settings => Domain-Settings => node => 404 settings) but this is not an ideal solution since:

    • I have to create a custom 404 template for every language
    • SeoChecker is intercepting the request before it can reach my custom IContentFinder implementation

    I would like to know which is the idiomatic way of treating this problem in umbraco...

    thank you, Martina

  • Jonathan Distenfeld 105 posts 618 karma points
    Jan 23, 2020 @ 07:05
    Jonathan Distenfeld
    100

    Hi Martina,

    Seems like urls with dots are handled differently by umbraco. Maybe ths post could help you out?

    https://our.umbraco.com/forum/umbraco-7/using-umbraco-7/70772-custom-404-page

    ~ Jonathan

  • Martina R 9 posts 90 karma points
    Jan 23, 2020 @ 17:08
    Martina R
    1

    Thank you Jonathan.

    To be honest I already saw that post and tried all the proposed solutions to no avail.

    Today I reverted to a clean state and tried again.

    This worked for me:

    <httpErrors existingResponse="Replace" errorMode="Custom">
        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" prefixLanguageFilePath="" path="..." responseMode="ExecuteURL" />
    </httpErrors>
    

    It seems I was using existingResponse="PassThrough" instead of existingResponse="Replace"

  • 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