Rectangle 27 0

php ErrorDocument & Mod Rewrite?


Are you expecting some new wave of HTTP Status Codes to hit the web in the near future that you can't just make a list of 10 or so error codes that point to the correct corresponding documents? You really should just go through the List of HTTP status codes and pick out which ones your server would actually use and set error documents for those ones. An ordinary web server would probably only ever see a 404 and a 500, maybe a 403 if it the permissions weren't configured correctly, and maybe a 509 if you're on a shared web service (although I think that one is handled by the hosting provider anyways). If you're not building some very advanced web server that can do a whole lot of different things, you're just wasting your web server's microscopic time looking for all those error codes it will never use.

But seriously, don't list every single status code from 400 to 510. Seriously. A lot of those would be status codes you'd manually send from the executing script when it determines something is wrong.

Is there any kind of conflict between rewrite rules and errordocuments?

No, an ErrorDocument will be used if the final path determined by RewriteRules doesn't exist or you don't have permission to the file, whatever the reason is.

Note