Copied to clipboard

Flag this post as spam?

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


  • Johnathan Le 10 posts 40 karma points
    Jul 13, 2023 @ 03:27
    Johnathan Le
    0

    Redirect to root page instead of showing 404 Page not found content of Umbraco

    Hi all,

    I need your help. When user enters the wrong url, by default Umbraco will show the Page not found content. From our client request, we need to redirect back to root instead of showing any content. I have tried to use IContentLastChanceFinder or Middleware such as UseStatusCodes (not working, Umbraco might disable this feature in Pipeline), ErrorHandling (it hitted but the response data has been returned).

    Any suggestion from yours ?

    Umbraco version: 11

    Thanks

  • Huw Reddick 1770 posts 6157 karma points MVP c-trib
    Jul 13, 2023 @ 15:51
    Huw Reddick
    0

    I've not tried this, but could you not just set the guid for the 404 handler to be the guid of your home page?

    "Error404Collection": [
     {
       "Culture": "default",
       "ContentKey": "abd58ca0-c700-47f3-b7ab-6672583572ce" <-- Guid of homepage
     }
    ]
    
Please Sign in or register to post replies

Write your reply to:

Draft