Back to all posts

Properly Using DNN's Custom 404 Page

Posted on Sep 24, 2016

Posted in category:

Recent issues with a few clients I have encountered some "unusual" behaviors. Either a situation where we had an unusual redirect situation, or we had pages that were showing HTTP 200 (success) status responses when in all reality the page truly didn't exist. In the end, we had an IIS customization configured to handle certain types of 404's that DNN wouldn't handle, such as those for missing images, javascript files, and more. Nothing that we haven't done for quite a while.

However, in this situation the DNN "Site Setting" option for a custom error page was used to make a very friendly looking "Not Found" page and the IIS Redirect was sending people there. This was the root cause of the unusual behavior, as if you visit that page directly, such as if you wanted to edit it, you get an HTTP 200 status.

To get the page to properly work as a 404, not found, the page you need to add ?status=404 to the URL. The root cause fix was to change the redirect from /404-Error-Page to /404-Error-Page?status=404.

Hope this helps someone that might be experiencing some unusual redirects or 404 behaviors.