Custom Error Pages
From Lunarpages Web Hosting Wiki
You can design and create your own error pages on your hosting account from cPanel. Using the built in tools, you can do all of this right from the control panel interface. This is just one more perk for those web hosting customers that have access to cPanel for their hosting account.
How to Create Custom Error Pages in cPanel
To get started, you need to login to your cPanel account. Once you have made it to the front page, search the page for an icon marked "Error pages". Now, click that icon to be taken to the Custom Error Page screen.
With this tool you can create custom error pages to display when a user enters a wrong URL, an outdated URL or when the user is not authorized to access a specific directory of your web space. You can setup a custom error web page for:
- 400 (Bad request)
- 401 (Authorization required)
- 403 (Forbidden)
- 404 (Wrong page)
- 500 (Internal server error)
As an example, let us say you click on the 404 link to create a custom 400 error web page. You can use these steps to help you create any of the above error pages.
You want to enter your web site code into the big empty text box. It can be HTML to help match the look of your web site. You can also enter any of the variables given above the text box too. They will dynamically display the information based on the details of the visit. They are:
- Referring URL
- Visitor's IP Address
- Requested URL
- Server Name
- User's Browser
- Status Code
When you are done, save the document and you are done. It is recommended to leave the file name as it is, but you can change it if necessary.
Manually Create Custom Error Pages
Ever check out some of those customized error pages and wonder how it could be done? The process if fairly easy and the magic can be worked with just a little editing to your .htaccess file. As an example, here is the code that would need to be copied and pasted into your .htaccess file to get this customized error page effect:
ErrorDocument 400 /errors/400.html ErrorDocument 401 /errors/401.html ErrorDocument 403 /errors/403.html ErrorDocument 404 /errors/404.html ErrorDocument 500 /errors/500.html
This tells the server to look inside the “errors” folder and that specific page for each of the different error types.
That is not all of the error codes, but they are the ones that will be ‘hit by your users 99 percent of the time. Now instead of being taken to the default error page for the server - you can have your own customized error page for your clients to see when something goes wrong.
Please Note: You will need to add the code manually to the .htaccess file, for subdomains and addon domains.
Want to read this in another language? | Web Hosting Support Categories: Beginner | Billing & Sales | Web Design | LPCP | cPanel | Plesk | Quicksite | PageMason | E-mail | Databases | Domain Names | Reseller | Dedicated | VPS | ASP | JSP | PHP | Third Party Scripts | Affiliates | Misc |
Lunarpages Deal: Save $72 on your next Business web hosting plan! Starting at $18.95 per month, this an offer you can't miss. Perfect for business and e-commerce hosting sites, comes with free e-commerce tools and a TremenDesk Help Desk. Limited time offer!


