: What errors should I create custom pages for besides 404? I know most sites typically create a custom 404 page. Are there any other custom error pages I should create? Or just watch my
I know most sites typically create a custom 404 page. Are there any other custom error pages I should create? Or just watch my logs and see which ones are hit more frequently?
[Edit]
This is for a PHP web app, not a blog or static html site.
More posts by @Vandalay111
5 Comments
Sorted by latest first Latest Oldest Best
For most sites 404 and 500 are all you need. If your site has a member login then you could use a 401, but most times you want to redirect to a login page for this rather than displaying an "error".
It's nice to keep redirects, authentication requirements, and other miscellaneous housekeeping in a single script for a variety of reasons.
I use a modified version of this PHP handler script for 404's and 301's - you will probably want to set up static 500-series pages (so your web server can return something useful in the event that the PHP parser is failing for whatever reason).
We just have a 404. The big trick we did is that our 404 script looks for moved pages, and throws the moved status correctly.
On my sites, I create error pages for errors that I think people may commonly run across. Other than 404, here are the ones I target:
500: Internal Server Error - if your app fails, showing a generic 500 error page will only confuse users
403/401: Forbidden/Unauthorized - I display a custom error page when a user tries to access something that they're not allowed to access.
400: Bad Request - pretty self-explicable
409: Conflict - if a user is blocked from some functionality by the throttling/rate-limiting, I tell them to try again
It's difficult to give you a direct answer if you don't provide an example use case.
Here is a list with all Status Codes you can/should use for differrnt cases (redirected, removed, etc.). So you could search for your case, select the right code and if it is necessary create a costum error page.
Here are the examples who maybe needs a costum error page quoted from my apache.conf:
Customizable error responses come in three flavors:
1) plain text 2) local redirects 3) external redirects
Some examples:
ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /missing.html
ErrorDocument 404 "/cgi-bin/missing_handler.pl"
ErrorDocument 402 www.example.com/subscription_info.html
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.