Knowledgebase
Portal Home > Knowledgebase > Custom Error Pages
Custom Error Pages
| Although CPanel may provide an option labeled "Custom Error Pages", it seems to save in shtml format (somefile.shtml). There is another way to create custom error pages in the form of editing the .htaccess file:
- Download/open for editing the .htaccess file
- Scroll down to the bottom
- Type ErrorDocument 404 /404page.html where 404 is whatever error you want to handle (400, 401, 403, 404, 500), and /404page.html is the document relative to the folder the .htaccess is located in; e.g. if .htaccess is in the public_html folder, then /path/404page.html will refer to the document in public_html/path/404page.html.
- If needed, reupload the .htaccess back to the appropriate directory
You are not restricted to html files; you can set a php, htm, html, or shtml file to be the error page.
List of common error codes and their meanings:
- 400 - Bad Request
- 401 - Authorization Required
- 403 - Forbidden
- 404 - Page/file not found
- 500 - Internal Server Error
|
Add to Favourites
Print this Article
|