How to Set Up Custom Error Pages for My Website
How to Set Up Custom Error Pages for My Website
Category: Tools & Settings
Understanding Custom Error Pages
When an error occurs on your server, it typically displays a generic error page that doesn’t match your website’s layout. Custom error pages can enhance the user experience by providing relevant information and maintaining your site’s branding.
Methods to Set Up Custom Error Pages
There are two primary methods to set up custom error pages:
1) Using the Subdomain Manager
This method is simple and effective for setting custom error pages for server errors 400, 401, 403, and 404:
- Go to My Domains > Hosted Domains in your Web Hosting Control Panel.
- Locate your domain and click on the Edit Domain icon from the Actions column.
- You will find fields to set custom error pages for:
- Error 400 page:
- Error 401 page:
- Error 403 page:
- Error 404 page:
- Initially, these fields are set to "Default". To customize, select "Custom URL" and enter the path to your custom error page.
- If you haven’t created the error pages yet, do so before returning to update these settings.
2) Using .htaccess
Alternatively, you can set up custom error pages by editing your .htaccess file:
- First, create your custom error page(s).
- Access the File Manager in your Hosting Control Panel and navigate to your domain/subdomain folder (typically located inside the
www/
directory). - Create a new file named
.htaccess
if it doesn’t exist. - Edit the
.htaccess
file and insert the following lines:
ErrorDocument 400 /custom400.html ErrorDocument 401 /custom401.html ErrorDocument 403 /custom403.html ErrorDocument 404 /custom404.html
Ensure that the paths and names correspond to the actual locations of your custom error pages. This method overrides any settings in the Subdomain Manager and works universally.
Tags: .htaccess configuration, 404 error page, custom error pages, server errors, Subdomain Manager, web hosting settings"> <link rel="stylesheet" href="styles.css, website error handling