How to Set Up cPanel Custom Error Pages
Whenever there's a problem accessing your website, your visitors will receive an error message. Each message has its own page and code specific to the problem encountered. Although the web server automatically provides basic error pages, with the Error Pages tool in the cPanel, you can create custom error pages to display when a user enters a wrong URL, an outdated URL, or the user is not authorized to access a specific directory of your webspace.
Note: If you already have error pages created, it's not necessary to follow this tutorial. You may instead add the following to your .htaccess file:
ErrorDocument error-number /Your-Error-file.html
Where error-number is the error code used by apache, for example, to use the file "notfound.html" as a 404 error page:
ErrorDocument 404 /notfound.html
Customizing Your Error Pages
- Log in to your Bluehost.com control panel.
- Click on the Websites tab from the side navigation menu to the left.
- Under Advanced tab click Manage under cPanel section.
- Click the Error pages icon located in the Advanced section. This will take you to the Error pages menu.
- Below "Step 1," click the ▼ button, and then select a domain for the customize error pages.
- Below "Step 2," click on the Show All HTTP Error Status Codes tab to view all error pages.)
All the error page numbers and names will appear, such as (400, 401, 403, 404, 500) and (Bad request, Authorization required, etc.).
- When the selected Error Page loads, the following six tags are available:
Tags Functions Referring URL Displays the URL of the website the visitor was previously viewing. Visitor's IP Address Displays the IP address of the visitor viewing the error page. Requested URL Displays the intended URL the visitor is trying to view. Server name Displays the website's server name. Visitor's browser Displays the visitor's browser type such as IE, Firefox, etc. Redirect Status Code Displays the type of code in the 300-307 range. Note: You don't have to use any of the above tags. They are available to you based on your preferences and needs specific to your website.
You can place any HTML code or text in the error page specific to your own preferences and needs specific to your website.
When you save your page, the file name will default to the error number you selected with the addition of a .shtml extension. For example, if you chose 400, your file would appear as "400.shtml." You can modify this name to the code you want. Only modify this to an error that you know will be shown on your website.
After you save your error page:
- Click the Go Back button to return to the Error pages menu to edit a different Error Page or
- Click the Home icon in the upper left-hand corner to return to the cPanel main menu.
Tip: You can find what error codes are being shown to your visitors by viewing any of the available website statistical analysis programs built into cPanel, such as Awstats, Webalizer, etc.
Common Problems
- Try refreshing your browser if you still see the Bluehost default error pages (ctrl + F5).
- If you still see the Bluehost default pages, add the following code to your
.htaccess
file in thepublic_html
directory:ErrorDocument 403 /403.shtml ErrorDocument 404 /404.shtml ErrorDocument 500 /500.shtml
- You can even use existing pages as the resulting page. For instance, if you don't want any visitors seeing 404 errors on your site, you can make your home page the result like:
ErrorDocument 404 /index.html
- If Internet Explorer is not displaying the custom error page, it is likely because the error page must be larger than 1 kilobyte.
Related Articles
- What do Error Pages Mean?
- What Is a 404 Error Code? How They Happen and Why You Should Fix Them
- What Is a 401 Error? Most Common Causes and How To Fix It
- WordPress Blank White Pages (WordPress White Screen of Death)
If you need further assistance, feel free to contact us via Chat or Phone: You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.