Forum Moderators: phranque

Message Too Old, No Replies

custom error document 500. returning 500's

         

Readie

11:28 pm on Feb 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, a short while ago I had some (much appreciated) assistance regarding me getting 500 errors. I wasn't too fussed at the time about this, being more concerned about fixing the actual errors, but the 500 errors were also saying something along the lines of:

"additionally, a 500 error was encountered trying to use a custom error document"

Or words to that effect.

I'm wondering if anyone knows what may be causing this, as my other error documents work fine (atleast, I know my 404 and 401 work fine), and are listed in my .htaccess as:

ErrorDocument 400 /400page.php
ErrorDocument 401 /401page.php
ErrorDocument 403 /403page.php
ErrorDocument 404 /404page.php
ErrorDocument 500 /500page.php

jdMorgan

3:19 am on Feb 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should exclude "500page.php" from *all* rewrite rules (exit immediately at the top).

# Exit mod_Rewrite immediately if processing a 500 error
RewriteRule ^500page\.php$ - [L]

And I will recommend that you *not* use php for your 500-Server Error page, because 500 error processing should have as few dependencies as possible. Use a simple, static HTML page, or even the default Apache error message for 500 errors. Having got one 500 error, you can be pretty sure your server is broken, so reporting the 500 error should depend on as few things as possible that might be broken...

Jim

Readie

4:24 am on Feb 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By exit immediatley at the top, do you mean have:
RewriteRule ^500page\.php$ - [L]
Immediatley at the start of my .htaccess file?

And yes, I suppose it probably is wise to not have a server dependant file during a pretty severe server failing

jdMorgan

2:42 pm on Feb 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Put that at the top of the mod_rewrite code section of your .htaccess file, after "RewriteEngine on".

Jim