#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,167
    Rep Power
    220

    What is the best way of redirecting internal server errors 500?


    Hello;

    What is the best way of redirecting internal server error like this to another page?

    Thanks
  2. #2
  3. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,279
    Rep Power
    9645
    1. Make PHP not send 500s when it has a problem. I honestly don't know how or when that happens but I'm sure somebody else does.
    2. Use an ErrorDocument. This will catch the case when it's not PHP but something else causing a problem (which should never be the case on a live server).
  4. #3
  5. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,167
    Rep Power
    220
    Originally Posted by requinix
    1. Make PHP not send 500s when it has a problem. I honestly don't know how or when that happens but I'm sure somebody else does.
    2. Use an ErrorDocument. This will catch the case when it's not PHP but something else causing a problem (which should never be the case on a live server).
    I have an htaccess that redirects. I assume that there are some pages indexed that do not exist. As it is a mod_write rule that redirects and it doesn't exist, it shows 500! I couldn't use the link you send
    : (
  6. #4
  7. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,279
    Rep Power
    9645
    Originally Posted by zxcvbnm
    I have an htaccess that redirects. I assume that there are some pages indexed that do not exist. As it is a mod_write rule that redirects and it doesn't exist, it shows 500!
    If mod_rewrite tries to redirect to something that doesn't exist then you'll get a 404.

    So it's not a PHP page causing this? Look at the server logs to see what the problem is.

IMN logo majestic logo threadwatch logo seochat tools logo