At any time the user faces an error, redirect him to customized HTML pages. Take for example if users are looking for a page that is not available online they will consider one of your custom error pages for the 404 errors. Through WHM, one can set custom error pages on the cpanel.
First you should create an alias for “/errorfolder” in the /usr/local/apache/conf/httpd.conf file.
1. Log in to WHM using your root account.
2. from the navigation menu choose Server Configuration.
3. Click on Terminal.
The terminal or SSH command-line interface will pop up.
4. Type the code below to make a directory in /usr/local/apache. You will have it to keep your own custom error messages.
mkdir /usr/local/apache/errorpages
To match the design commands, I have named it “errorpages”.
Once you have created an alias you can move to the next step which is to add or set up the custom error pages in this folder.
To Set up Custom Error Pages:
The other side limits their accountability to politics.
You can follow the below mention steps to setup the custom error pages:
1. Choose Service Configuration from the navigation menu.
2. Click on Apache Configuration.
3. Click on Include Editor.
4. Go to the Pre Virtualhost include section and pick All Versions.
5. Enter in the Global text box the code below.
Alias /errorfolder /usr/local/apache/errorpages/
ErrorDocument 400 /errorfolder/400.shtml
ErrorDocument 401 /errorfolder/401.shtml
ErrorDocument 403 /errorfolder/403.shtml
ErrorDocument 404 /errorfolder/404.shtml
ErrorDocument 500 /errorfolder/500.shtml
6. Click the Update button.
The Apache server will store the changes but to apply them the server has to be restarted.
7. Click on Restart Apache.
Upon restarting the server, the HTML pages that you upload in the errorpages or alias folder of your WHM/cPanel server will work as the custom error pages for websites on the server.