Peggy Zhu (Customer) asked a question.

Custom 404 page stopped working after Sitefinity update

Hi everyone

 

Since updating Sitefinity, our 404 page is no longer working correctly.

 

We’ve noticed two issues:

  1. When we open the 404 page in Sitefinity to edit it, it shows the homepage content instead of the 404 page content. However, the correct 404 content still appears when we visit the 404 URL directly.
  2. When someone enters an incorrect URL, they are redirected to the global homepage instead of the 404 page.

The 404 page is still accessible using its direct URL, but it is no longer working as the error page.

 

Environment Details

  • Product Version: 15.4
  • Build Version: 15.4.8625.0
  • Product File Version: 15.4.8625.0

 

Has anyone experienced this issue or know what settings we should check?

 

Thanks! 😊


  • Sabrie Nedzhip (Enso DX)

    Hi @Peggy Zhu (Customer)​ ,

     

    • You can check the web.config file and look for the redirect rules, if any?

    Check for customErrors tag and check the redirect path for the 404 also the defaultRedirect property

    1. <customErrors mode="On" defaultRedirect="~/">
    2. <error statusCode="404" redirect="~/" />
    3. </customErrors>

    You can also check for httpErrors in the web.config file.

     

    1. <httpErrors errorMode="Custom">
    2. <clear />
    3. <remove statusCode="404" subStatusCode="-1" />
    4. <error statusCode="404" path="/error-pages/404" responseMode="ExecuteURL" />
    5. </httpErrors>

     

     

    • It looks like you are using custom error pages? You can check under Administration -> Settings -> Advanced -> Pages -> Custom error pages. Do you have an entry for 404? Check the error page url name if it is correct?

     

    image 

    • Also, in other forum threads you mentioned that you have a global site and three regional sites. Does the issue happen on all sites - including global and regional? Does it happen also when you run the project locally? This way we can see if it is related to a specific site or specific or environment (local, auth, production).

     

     

    • It could be also that you have some javascript or other logic on the 404 page itself. Because you cannot edit it (it redirects to the home page when you try to edit) you can try to duplicate with different name and url name so you can edit and see the widgets dropped there and check for any javascript that executes on the page.

     

    Let me know and then we can see what else we can check.

     

    Regards,

    Sabrie

  • Peggy Zhu (Customer)

    Hi Sabrie, thank you so much for your response.

    Yes, we do have a few different regions. When we go into the 404 page for each region, they all seem to display as the “homepage.” However, the 404 functionality for NZ and the UK is working correctly. If we enter an incorrect URL, we are redirected to the 404 page as expected.

    For AU, the AU 404 page is displaying the AU homepage content. Also, if we enter an incorrect URL on the AU site, instead of being redirected to the AU 404 page, it redirects to the Global homepage.

    Because of this, I suspect there may be an issue with both the Global and AU environments and how the 404 page is configured or redirected.

    Thanks!

     

    Peggy

  • Sabrie Nedzhip (Enso DX)

    Hi @Peggy Zhu (Customer)​ ,

     

    Thanks for the details.

    And yes, it looks like there is an issue with these specific environments - Global and AU. Either the system cannot find the 404 pages on these sites or there is some logic on the 404 pages that causes the redirect.

     

    What you can check is the following:

     

    1. Check the url names of the other 404 pages on the working sites (NZ and UK) and then on the Global and AU sites where you have the issue. The system checks by url name of the 404 page (it is configured under Administration -> Settings -> Advanced -> Pages -> Custom error pages - then the specific entry for the 404 error pages - the error page url name field). But you don't need access to this because you have the working sites to compare to.
    2.  If the url names of the pages are good, then you can duplicate the error page on one of the non-working sites - with different name and url name. Then try to edit it. Let me know if you can edit this duplicated error page or it still redirects to the home page.
    3. If you can edit the redirect page check the widgets on this page. Some custom logic may come from widgets on the page causing this redirect.

     

    Regards,

    Sabrie