Copied to clipboard

Flag this post as spam?

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


  • Matthew Greengrass 1 post 71 karma points
    Nov 03, 2022 @ 16:45
    Matthew Greengrass
    0

    XPath custom error page not working

    Have a page called 404. To add a custom 404 page as per the documentation here: https://our.umbraco.com/documentation/tutorials/Custom-Error-Pages/

    This was added to the appsettings

    "Error404Collection": [
              {
                "Culture": "default",
                "ContentXPath": "//errorPages[@nodename='404']"
              }
    

    But returns the following error:

    Could not parse xpath expression: //errorPages[@nodename='404'] System.InvalidOperationException: XPathValue must be an XPathNavigator or a string.

    This has been working for months and has seemingly broken after a recent umbraco upgrade to 10.2.1. Parsing the error page by the page content key still works.

    Any help or comments appreciated

  • Heather Floyd 610 posts 1033 karma points MVP 6x c-trib
    May 02, 2024 @ 18:31
    Heather Floyd
    1

    Some related GitHub Issues:

    v11.2 - https://github.com/umbraco/Umbraco-CMS/issues/13907

    v13 - https://github.com/umbraco/Umbraco-CMS/issues/15582 - This one discusses a bug in Umbraco Core, and there are various work-arounds

  • apload-gmbh 39 posts 109 karma points
    May 03, 2024 @ 09:38
    apload-gmbh
    0

    We set directly the ID of the error page in the appsettings. Not very dynamic, but the ErrorPage isn't some we or our clients do change.

    "Error404Collection": [
      {
        "Culture": "default",
        "ContentId": 1137
      }
    ],
    
  • 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