Copied to clipboard

Flag this post as spam?

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


  • bikeman 21 posts 102 karma points
    Jan 29, 2021 @ 13:37
    bikeman
    0

    Custom 404

    I've followed the instruction in https://our.umbraco.com/documentation/tutorials/Custom-Error-Pages/ to update the umbracoSettings.config file with my error page.

    It works with a page ID or GUID but not with a page URL.

    How do I redirect to /error404/

    Thanks

  • Huw Reddick 335 posts 1007 karma points
    Jan 29, 2021 @ 13:44
    Huw Reddick
    0

    create your content page called error404 and then use it's id in the umbraco config, that is basically it, or at least that is all I have done and it works fine.

  • bikeman 21 posts 102 karma points
    Jan 29, 2021 @ 14:52
    bikeman
    0

    As per my OP I want to use a page URL not a page ID.

  • Huw Reddick 335 posts 1007 karma points
    Jan 29, 2021 @ 14:57
    Huw Reddick
    0

    it requires either an id, a guid or an xpath,

    Why do you need to use a url when it already has a perfectly good working way of doing it

  • bikeman 21 posts 102 karma points
    Jan 29, 2021 @ 15:02
    bikeman
    0

    Because it's a multi site and each site has a custom /error404/

    I wanted to use an xpath but the example doesn't work or any variation I tried.

  • Huw Reddick 335 posts 1007 karma points
    Jan 29, 2021 @ 15:24
    Huw Reddick
    0

    could you show us the xpath you are using then, I would imagine that is where the issue is.

  • bikeman 21 posts 102 karma points
    Jan 29, 2021 @ 15:35
    bikeman
    0

    I don't understand the example given:

    • An XPath statement (example: //errorPages[@nodeName='My cool error']

    I tried my url and I tried substituting my page url in the @nodeName='/error404/'

  • Huw Reddick 335 posts 1007 karma points
    Jan 29, 2021 @ 15:56
    Huw Reddick
    0

    It should work using xpath, this is what I have just tested in place of my ID

    <error404>//customErrors[@nodeName='Error404']</error404>
    

    customErrors is the document type and Error404 is my 404 document

  • bikeman 21 posts 102 karma points
    Jan 29, 2021 @ 16:04
    bikeman
    0

    Unfortunately that doesn't display the relevant site's 404 page.

    The 404 page from site 1 is always displayed.

  • Huw Reddick 335 posts 1007 karma points
    Jan 29, 2021 @ 16:12
    Huw Reddick
    0

    since I don't know how your site works it is a bit difficult to give you an exact answer, you will need to add some other parameter to the xpath to get the exact one or If it is culture based you could add a 404 setting for each culture as shown in the settings config file

  • bikeman 21 posts 102 karma points
    Feb 01, 2021 @ 16:08
    bikeman
    0

    ok thanks. I'll try to find out.

  • 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