#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Posts
    2,566
    Rep Power
    171

    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. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,742
    Rep Power
    9397
    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 Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Posts
    2,566
    Rep Power
    171
    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. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,742
    Rep Power
    9397
    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