How do I create custom error pages?

There are 2 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) Client the error page type from the list.
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.

1) Create a website file for the error page and upload it to your account.
2) Type the following into your .htaccess file

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
  • 1 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

Do you support mod_rewrite for apache?

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

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

.htaccess Redirect/Rewrite Tutorial Part 1 - How do I redirect all links for www.domain.com to...