Question and Answer Post :

Question :

I am running cPanel 11 with apache.

I want a custom 404 page in php format. Currently its set to 404.shtml by default, even if I change the file name from 404.shtml to 404.php (under cPanel’s “Custom Error Pages”), it still redirects to 404.shtml. So I was wondering if there is an alternate trick to do this?

Answer :

.htaccess :

 

Code:

ErrorDocument 404 /404.php

Don’t forget the beginning slash (/), otherwise it would search the file at wrong places