Hi, 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? Please guide Thanx
.htaccess : ErrorDocument 404 /404.php Code (markup): Don't forget the beginning slash (/), otherwise it would search the file at wrong places
ok there is now a small glitch. If I place www in the URL, it works fine on Firefox and Opera but does NOT work in IE. IE says the page does not exist. http://www.resumehype.com/saurav With IE I need to remove the www to view the page http://resumehype.com/saurav Any solution for this? Thanx
Sorry for bump, but in IE a custom error page needs to be 512 bytes or bigger. If you can't reach this, add some hidden commented data like: <!-- Internet explorer sucks --> Code (markup):
Why dont you do what I do. I created a page using my script, and then placed a redirect in .htaccess, so that it went there. www.WebGamesNetwork.com/thiswillredirecttomy404page.php try it
If you do a redirect to your 404 page then the HTTP status codes that get returned are 302 followed by 200. If you use the ErrorDocument directive then you get a 404 HTTP status code. This won't make much difference to normal users viewing your site in a browser but it makes quite a big difference to search engine bots and automated scripts. A 404 "Page not found" will be treated differently by Google than a redirect to a normal page that tells you it can't find what you were looking for. If you do the redirect method and you have a lot of broken links on your site you could even find that your custom "Not found" page has the highest page rank on your site !