Custom Apache server error pages

If you are on an Apache server and want to have custom error pages then follow this guide. To have custom error pages on an Apache server you will need to setup or modify your .htaccess file in your main public directory. This directory is typically named “public” or “public_html” depending on the control panel and type of server your web host has setup your website on.

1.) Make sure there is a .htaccess file in your main public directory. The main public directory may be called “public”, “public_html”, “www”, and possibly another name. This directory is where you would put your typically upload your files to.

2.) Check to see if there is a .htaccess file inside that directory. It is a dot file so you may have to make sure your FTP software is showing dot files on the server.

3.) If there is an existing .htaccess file you may edit it. If there is no existing .htaccess file then you will need to make a new .htaccess file.

4.) If you are editing the existing .htaccess file, add the following to the file:

ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html

If there is no such .htaccess file already on your server. You may create a new simple text file and put the above code in that file. Make sure to save the file as .htaccess and upload it to your web host.

5. Now you can create your own custom error pages and named them 403.html, 404.html, and 500.html. These are the most common error pages shown when visitors may encounter errors on your website. After you have created your custom error pages, you can upload them to your web host.

What each file/status code means:

403.html = Forbidden Access

404.html = Not Found

500.html = Internal Server Error