Creating custom error pages in cPanel is simple and easy process, and only takes a few minutes to set up. For the purpose of this article, we will be creating a custom 404 error page. If you haven’t done so, please consider reviewing our article What is a Custom 404 Error Page? for more information on this specific response header and the effect it can have on your visitors or search engine ranking.
- Log into your cPanel account
- Scroll down to the advanced section and click the Error Pages icon:
- If you have multiple domains in your cPanel, select the domain you are creating the page for from the Managing menu:
- You will see a list of Common Error Codes, click the one you want to create a custom error page for. Again, for the purposes of this article example, we will be choosing to create a custom 404 error page, but you would choose your desired choice here instead.
The available choices are- 400 (Bad request)
- 401 (Authorization required)
- 403 (Forbidden)
- 404 (Not found)
- 500 (Internal server error).
- You will then be on an editor page. You can enter HTML code here, or insert premade tags if you want. Below is a brief description of the available tags.
Tag Description Referring URL Lists the URL you came from. Visitor's IP address Lists the IP address of your site visitor. Requested URL Shows the URL you are attempting to access Server Name Shows the name of the server. Visitor's Browser Lists the the visitor's browser type. Redirect Status Code This will display the error message code, such as 500, or 404, etc.
For our example, we will use the following: - Click the Save button at the bottom when you are finished.
- The result will be that when visitors attempt a request that will generate one of these errors the custom error page you created will be displayed instead of the generic one. The example code above generated the following page, when we attempted to request doesnotexist.html which, of course, does not exist on the server: