How do I create a custom error page?

There are two ways to create a custom error page:

The easy way:
  1. Log in to your cPanel.
  2. At the bottom of your control panel under the Advanced section, click 'Error Pages'.
  3. From the drop-down menu, select the domain you want to create the custom error pages for.
  4. In 'Edit Common Error Codes', click the page you want to edit.
  5. Type in whatever you want the error page to say.
  6. Click save.
The professional way:
Having error pages that look like your website will make your site seem much more professional in the unlikely event of an error.

You can use custom error pages for any error as long as you know its number (like 404 for Page Not Found) by adding the following to your .htaccess file:

ErrorDocument errornumber /file.html

For example, if I had the file notfound.html in the root directory of my site and I wanted to use it for a 404 error I would use:

ErrorDocument 404 /notfound.html

If the file is not in the root directory of your site, you just need to put the path to it:

ErrorDocument 500 /errorpages/500.html

These are some of the most common errors:

401 - Authorization Required
400 - Bad request
403 - Forbidden
500 - Internal Server Error
404 - Wrong page

  • 0 Users Found This Useful
這篇文章有幫助嗎?

相關文章

How do I perform a URL redirect/rewrite using the .htaccess file?

PART I : How do I redirect all links for www.domain.com to domain.com? Description of the...

.htaccess Tutorial

In this tutorial you will find out about the .htaccess file and the power it has to improve...

Do you support mod_rewrite for apache?

Yes, we do support Mod_rewrite. Mod_rewrite is enabled on all servers. For more information on...