Custom 404 error page without URL redirect

Kevin Kim-Murphy asked on May 24, 2018 18:34

Hi. My SEO team is recommending that we setup our Custom 404 error handling to NOT be a redirect. I have created a custom page named 404, and entered it in the Settings > Content > Page not found > Page not found URL field.

The behavior, as expected, is that when a user goes to this URL:

The user is redirected to the URL:

Per my SEO team, this results in a "200 OK" response an not a 404 response for the incorrect or non-existent URL.

Their requested behavior is that for the URL: The browser retains that URL in the address bar, returns a 404 handling error and displays the custom content from the custom 404 page I have created.

Per the Kentico 8.2 documentation this is what is stated on the Custom Error Handling page:

You do not need to manually handle the HTTP response code of the page specified by the setting. The page automatically returns a 404 status code when accessed (applies to both pages and physical pages). This allows applications, services and web crawlers to find out that a page not found error has occurred.

Can Kentico be configured for the behavior my team is requesting? Or is this a server side configuration (or web.config congfiguration)?

Please advise.

Thank you in advanced for your assistance.


Recent Answers

Juraj Ondrus answered on May 25, 2018 09:37

I Am unable to reproduce the issue on a clean Kentico 8.2 instance. I have set the Page not found setting to a page existing in my content tree, for example the value is: ~/PageNotFound.aspx
When I request a non-existing page, I am getting the 404 status code. From your description is not clear what other URLs and SEO settings are set in your instance. There should not be required doing anything else.
Was this instance upgraded from older Kentico version? If yes, maybe there was set something in the web.config file. I would also recommend comparing your web.cionfig file with a clean instance config file - there is also option to set the custom errors in the web.config file so maybe it is set there.

0 votesVote for this answer Mark as a Correct answer

Kevin Kim-Murphy answered on June 20, 2018 18:30

Juraj, Thank you for the response. It sounds like my expectations for Kentico's behavior here is correct, it is just not working that way in our setup. Here is some clarification of our configuration:

  • We have one domain.
  • I have set the Page not found setting to a page existing in my content tree: ~/404
  • This was a clean install of 8.2 (not an upgrade)

I am hoping you have a suggestion for how I can obtain a copy of the web.config for a clean install. I would like to compare just to eliminate that from the issue.

Any other thoughts on how I might troubleshoot this further?

Thank you!


0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on June 21, 2018 13:59

I would recommend setting the Page not found value to be ~/404.aspx (in case you are not using extension less URLs setup).
If you have the setup files for the Kentico 8.2 installation, typically located at c:\Program Files (x86)\Kentico\8.2\, you can find the clean web.config file at c:\Program Files (x86)\Kentico\8.2\WebInstaller\Versions\Data\<.netVersionOrAzure>

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.