0
votes

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
Pretty is not the right word for this. I meant that I want proper output depending on the error code. This should be done dynamically by my php script. - Alex L
To clarify, I was looking for a script that has a message for each http error code. If $_SERVER[REDIRECT_STATUS] is 403, say Sorry but you are not allowed here. If $_SERVER[REDIRECT_STATUS] is 404, say Sorry page not found etc. - Alex L

2 Answers

2
votes

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

0
votes

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?