How to Create Custom 404 Error Page in Apache

A 404 error happens when a visitor comes to your website and the page requested is not found on your website. This happens when a link changed and some other pages or websites still link to your old web page URL.

When “HTTP/1.1 404 Not Found” error occurs, web servers show a basic error message saying the page is not found on the server. Most visitors will leave your website when this happens. A properly built custom 404 page allows your site to engage the visitor, present them useful information, so they stay on the website, explore other pages instead of leaving the website.

It is good practice to track 404 errors, set a 301 redirect for these pages to the proper destination, so your site visitors can find whatever they are looking for with fewer efforts.

To create a custom 404 error page in the Apache web server, create a .htaccess file with the following content

Create an HTML page with your custom 404 error message, save it as 404.html.

Now when you access a page that is not present on your website, you will see this custom 404 error page.

See htaccess

Leave a Reply

Your email address will not be published. Required fields are marked *