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.
|
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] |
||||
|
|
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:
|
|||||
|
|
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". |
|||
|
|
|
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. |
|||
|
|
|
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:
|
|||
|
|
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). |
|||
|
|