Spruce-ifying our error messages

Posted by T. Greg Doucette on Sep 5, 2010 in Technology | Subscribe

Good evening y’all! :D

The never-ending war on WordPress comment spam has been less-intense the past couple weeks, owing in large part to my hair-trigger tendency to add people to the .htaccess banlist :beatup:  I started keeping track of the raw number of referrers1 and IPs banned just for my own amusement, and in typical TDot fashion created a chart showing where things were as of September 1st.

See the footnote before complaining about my spelling :P

Banning spammers has the upshot of “purifying” the site stats — meaning the people who show up in the logs are now either (a) search engine crawlers or (b) honest-to-God humans — but it also raises the possibility a legit visitor might get banned because they happen to be accessing the site from a spam-tastic host.

I’ve been meaning to clean up the ErrorDocument files that our web server spits out when that sort of thing happens, but considering I’ve barely kept up with posting do you really think I got around to something that requires actual coding? :P

Fortunately it’s a long holiday weekend following an abbreviated school week, so today got to be the lucky day I sat down and hammered out some more tweaks. In lieu of studying of course :beatup:

Now if you happen to be one of those unfortunate souls banned from accessing the law-licious goodness of law:/dev/null because you or your fellow server denizens have engaged in scurrilous spamming or other electronic acts of villainy, you’ll be greeted with a page explaining that you’re forbidden from accessing anything and, more importantly, my email address if you think I’ve banned you in error. w00t for slightly-more-useful error messages.

Of course with the 403 Forbidden page getting a makeover, the 404 Not Found page was feeling left out so I tweaked that too. Now if you try to reach a post that no longer exists or you go somewhere that’s just plain silly (http://www.lawdevnull.com/pinkelephants/ for instance) the page will not only let you know the thing your looking for isn’t there but also — thanks to AskApache’s Google 404 plugin — provide you with Google-generated suggestions for what you might have been trying to find :)

Feel free to poke around and experiment, and if you notice any bugs or kinks or typos let me know! Actual law-related content coming soon, but until then have a great night!! :D

  1. Computer Science story: even though it’s misspelled, “referer” is frequently used when referring to HTTP referrers since the misspelled variant was in the proposal creating the HTTP specification way back in 1995… because the automated spellcheck back then didn’t recognize either referer or referrer :surprised:  You can’t make this stuff up folks! []

Tags: ,

Comments are closed.

Copyright © 2019 law:/dev/null All rights reserved. Theme by Laptop Geek.
Find TDot on Twitter or on Google+.