Copied to clipboard

Flag this post as spam?

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


  • andrew shearer 409 posts 517 karma points
    Feb 24, 2020 @ 03:32
    andrew shearer
    0

    is it possible for a 404 page to reflect the language variant in umbraco 8?

    Hello

    In a 1:1 multilingual umbraco 8 site with 3 variants, the ideal goal for my 404 not found page is:

    • www.example.com/this/is/not/a/page = English content message
    • www.example.com/chinese/this/is/not/a/page = Chinese content message
    • www.example.com/japanse/this/is/not/a/page = Japanese content message

    (i.e. the first segment in the bad url can still be used to determine language context.)

    I have defined a “IContentLastChanceFinder” content finder as per https://our.umbraco.com/documentation/reference/routing/request-pipeline/IContentFinder

    This almost works well, but the trouble is my error configuration means the umbraco 404 response is trumped by the IIS level settings, and triggers a second 404 url by which time the original language context has been lost

    <httpErrors existingResponse="Replace" errorMode="Custom">
      <remove statusCode="404" />
      <remove statusCode="500" />
      <error statusCode="404" path="/404contentfinder" responseMode="ExecuteURL" />
      <error statusCode="500" path="/ServerError.aspx" responseMode="ExecuteURL" />
    </httpErrors>
    

    The 500 rule is so the YSODs are replaced with a ‘friendly message’. I actually only want the httpErrors config to Replace 500, it would be great if I could “pass through” the 404 from Umbraco but alas the MS team don’t allow it to be set per status code ☹

    Anyone have any working solutions?

    Thanks heaps

    Andrew

  • andrew shearer 409 posts 517 karma points
    Feb 24, 2020 @ 19:22
    andrew shearer
    0

    btw sorry this is in the wrong group "Using Umbraco And Getting Started" - i can never work out how to post to a certain category i.e. Umbraco 8

  • andrew shearer 409 posts 517 karma points
    Mar 03, 2020 @ 02:47
    andrew shearer
    0

    would still be great to hear peoples thoughts/ideas here. :)

  • Frans de Jong 522 posts 1762 karma points c-trib
    Mar 03, 2020 @ 15:05
    Frans de Jong
    0

    I always use this package and use a content page as 404. This way it works with variants out of the box:

    https://our.umbraco.com/packages/backoffice-extensions/umbraco-page-not-found-manager/

  • andrew shearer 409 posts 517 karma points
    Mar 03, 2020 @ 18:59
    andrew shearer
    0

    ok thanks will check it 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