By editing the web.config file you can redirect users that encounter 404 or 500 errors to custom pages.
- Access to the DNN file structure and server.
When browsing for a resource such as a .txt or .asp that does not exist you will receive the static 404 page.
Note this also will fix receiving the static page for searching /bin or /web.config
Static 404 page:
- Inside of the web.config file in your DNN root directory, you will need to find the <system.webServer> tag.
- Add the following inside of the tag:
<httpErrors errorMode="Custom">In the path attribute, you can set the absolute URL of the custom error page that you will be redirecting your users to.
<remove statusCode="404" subStatusCode="-1" />
<remove statusCode="500" subStatusCode="-1" />
<error statusCode="500" prefixLanguageFilePath="" path="http://930engage.dnndev.me/en-us/newtest" responseMode="Redirect" />
<error statusCode="404" path="http://930engage.dnndev.me/en-us/newtest" responseMode="Redirect" />
- Save the web config and now when you browse to the same page that produced the static 404 you will see the DNN 404 page.
To test that the user is correctly redirected to the correct error page:
- Go to any page that does not currently exist for your site. You should be able to see the custom error page.