« Kinda A test- Kinda Not | Main | Practicing premeditation and playing with HTML »

Turning tb-spam off -- Way off

If you are having trouble with Movable type comment spam, Or any other blog spam for that matter, this trick might help you out.

A year or so ago, My very happy webhost, emailed me to notify me they had to turn off my mt-tb.cgi script because it was getting spammed to the point where it was bogging down the server.

There are Movable type settings and plugins that prevent junk trackbacks on old entries, but these work by having the mt-tb.cgi script look at the trackback, analyze it and then discard it. The analysis is costs processing power on the server. I came up with the following solution, which seems to work fairly elegantly

I added the following code to my .htaccess file:

RedirectMatch permanent mt-tb.cgi/([0-4][0-9][0-9])$ /mt/errorfile.html
RedirectMatch permanent mt-tb.cgi/([0-9][0-9])$ /mt/errorfile.html
RedirectMatch permanent mt-tb.cgi/([0-9])$ /mt/errorfile.html

Now, whenever anyone sends a trackback to mt-cgi/1 through mt-cgi/499 It gets redirected to an error page which is rendered. There is no analysis done, so I believe the load on the processor is significantly reduced. If you send a trackback to entry 500 or higher, the trackback goes through the regular script.

I will have to edit this periodically, but I do think this significantly limits the damage that spammers can do.


TrackBack URL for this entry:


Well, it has been 24 hours, and I have had 0 junk trackbacks! would say that is a Success. I was getting 10-30 per day before yesterday.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)