0

Hide Your Errors

I’m sure we’ve all seen them… the dreaded website errors.  You go to a website and you’re met with a bunch of programming gibberish you don’t understand (unless you’re a programmer).  Chances are, a lot of visitors will recognize this as ‘your page is down’ and will just hit their trusty Back button…  others may not be so kind.  These errors can disclose sensitive information about your site layout, database, and more… things you probably don’t want the world seeing.

Well, there are many fixes.  You can find them all over the internet so I won’t bother posting them all here, but I’ll share some of my favorites:

- Don’t write code with errors in it.  Just kidding…it happens to even the best programmers every once in a while – and it could be things out of your control, like having your hosts’ databases go down.

- Turn error reporting off for everyone, but leave it on for your IP address only.  You’ll feel safer, and your visitors won’t get a screen-full of errors (which, by the way, if it lasts long enough, can be cached by Google too).

- Use the db-error.php file in wp-content if you’re on WordPress.  If you don’t know about this, Google it.  Its awesome and you can even through an auto-mailer in there to let you know when your site goes down.  Here is a screenshot of what mine looks like:

db-error page - shows when your database is down

db-error

- If you must have (and show) errors to everyone, customize the error message that gets printed to the viewer.  Often this can help you diagnose and fix the problem better too because you’ll have more specific error messages.

There is a lot you can do.  I urge you to do it.  Now.  Stop sharing your errors with the world (or make sure they never ever see them).

Good Luck to ya!

Leave a Reply