views:

84

answers:

2

I would like to have pretty 404 pages, as well as other error pages.

I redirected all the errors (400, 401, 403, 404, 500, 502, 504) to my error.php.

Apache provides a lot of information in $_SERVER variable.

Do you know if there is good a ready script I can use for my error pages?

+2  A: 

I think the only important information you need is REDIRECT_STATUS and REQUEST_URI.

Gumbo
+1. This is pretty straight-forward stuff.
Frank Farmer
A: 

Do you have access to your apache config? If so, just specify custom files (404.html, 500.html, etc.) and populate them with appropriate HTML and CSS to make them as 'pretty' as you like. Or is there more of a problem here?

Bobby Jack
I would like to have a script that process the errors dynamically.
Alex L
Can you give a little more information? For example, what do you want to do differently in, for example, the event of a 404 as opposed to a 500, that isn't just a static page? You should be careful doing anything too processor-heavy as the result of an error page, since your server could easily be handling quite a few 404's (as the result of badly behaved robots).
Bobby Jack