When I add a custom 404 error page, then click save to 404.php. It brings up a;

---------------------------------------------
The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings

blah blah

Cannot find server or DNS Error
Internet Explorer
---------------------------------------------

How ever some times, if I set the filename to 404.shtml, it may save.

Any suggestions? It has to be php format. Because I have written a custom code to output an error message based on the URL the client browser its in. I had to to this because CPANEL dosen't support custom 404 pages for different directories, only one standard 404.