Creating a custom 404 Not Found page in Apache Server.

Read {count} times since 2020

You might have seen a 404 page on different sites such as Google,Yahoo etc… You can make this on your website too if you are using Apache Server. The default 404 page will be like this :

It’s just simple plain HTML 404 page and it’s ugly. To Change the default 404 page Do as below.
Go to your site’s folder.
Create a file named .htaccess (just .htaccess no name only file extension).
Open the file and add the line.

ErrorDocument 404 /pathtofile

Replace /pathtofile with your 404 page file name which should be situated in the same folder as the file .htaccess . The custom 404 file can be in PHP or HTML.
You can also add HTML to it like this:

ErrorDocument 404 ‘

404 Not Found-Subin’s Blog

You don’t have to reload Apache Server ! It’s finished. Test it out. Here’s an example of a custom 404 page.

Show Comments