You can configure the system to display custom pages instead of standard error messages. Custom pages help reduce the inconvenience caused to visitors if they run into an error while browsing your website, and also improves the security of the site by hiding potentially sensitive internal data (such as code in stack traces). You can create custom pages for this purpose with any kind of content, such as an apology or additional instructions, and then configure the system to display the pages in the appropriate situations.
Adding custom Page not found error pages
The Page not found error (404 HTTP status code) is one of the most common problems encountered by visitors. Kentico CMS provides several features that allow you to conveniently set up a custom page as a response. For page not found errors, the error page can either be a physical .aspx file placed under the web project or a dedicated document created in a specific website's content tree.
To assign your custom page to a particular website (or globally):
- Go to Site Manager-> Settings -> Content.
Enter the URL of the given page as the value of the Page not found URL setting, for example: ~/SpecialPages/PageNotFound.aspx
Since there are two possible types of error pages, the system interprets the URL in two different ways. The sample URL value above specifies either:
- The URL of a physical page named PageNotFound.aspx located in the web project under a folder called SpecialPages.
- If such a file does not exist, the system attempts to select a Kentico CMS document under the current website, with an alias path equal to /SpecialPages/PageNotFound.