How to easily redirect to your custom error pages on apache and PHP


With this tutorial you will be able to customize those Apache error messages like 404 (image below) with your suitable design.

 

 

Before that, you have to bear in mind that you need to have installed Apache and PHP in your website server.

First step, is to look for the .htaccess file on the root of your website (this could be hidden), and, if its not there, just create it as an empty file and add in there the following (according the error you want to customize the page):


Afterwards, you just need to create the corresponding page, ie: we will create 404.php in our root directory (or wherever you told in the .htaccess file).

And that’s it. You should now be able to look this when you access to a -not found- page.

 

Happy coding.!