David Walsh Blog

500

Over the past four or so months, I’ve been having a hell of a time with seeing 500 errors on my site.  And while I’m on my site a few hours a day, the amount of 500s my visitors must have seem is probably huge.  And that’s a problem.  A big, annoying problem.  The following details the situation from start to solution, so read on if you’d like to know how it all came and went.

The Symptoms

How did I know there was a problem and that it wouldn’t be an easy fix?  Well…

So all of this started happening more and more frequently.  And I was confused as hell.

The Variables

It was really hard to point to one specific issue that could have introduced the 500s.

All of these things were happening so what could I easily point to?  Nothing.

What I Did

As always I tried to fix the issue myself using process of elimination.

And still none of this made a dent.  Still seeing 500 errors left and right.  WTF.

Media Temple (Mostly) to the Rescue

At this point I needed to contact Media Temple:  I’m not a server admin and the issue was clearly beyond me.  So the volley of communications with Media Temple went as follows.

So there we go — being DDOS’d will most definitely kill your site.  So now what?

500 Prevention and Moving Forward

Here’s the gameplan for moving on:


	# F*** hotlinkers
	<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?davidwalsh.name [NC]
	RewriteRule \.(js|css)$ - [NC,F,L]
	</IfModule>

Notice I didn’t add image files because I want Twitter, Facebook, and other social networks to pick them up in Twitter cards, etc

Closing Thoughts

A few opinions and ideas to close my post out:

Thanks for reading and good luck in your own fights!