Digg Protection using htaccess

Today i just saw a referer to this site coming from Digg Upcoming page (i guess someone submit this blog to Digg website) although i doubt that it’ll reach the main page, but i think it is better for me to prevent this site from going down (the worst case is my page changed into my host suspended page) just in case someone submit this site to various big website and it appear there

And now this is the method is use to try to redirect everyone who came to this site from big site such as slashdot. Btw i found this method via PlanetOzh at Joseph Scott’s Blog which is taken from Ottodestruct (although i get 404 error not found message when i tried to visit the page mentioned in Joseph Scott’s blog) … and of course Full Credits goes to them because all i do is just adding “/” add the end and modify it as necessary to use in this site also changed the port to 8090 because coral cache use that port now instead of the old 8080 :)

So here’s the code :

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteCond %{HTTP_REFERER} ^http://(www\.)?digg\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?slashdot\.org [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?slashdot\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?fark\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?somethingawful\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?kuro5hin\.org [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?boingboing\.net
RewriteRule ^(.*)$
http://www.yourdomain.com.nyud.net:8090/$1 [R,L]
</IfModule>

As always the IfModule used to prevent your site goes berserk by returning HTTP 500 Error Code when modrewrite is not loaded in Apache. And i already tested this on this site, by faking the referer address to www.digg.com and digg.com without www (and as you can see, that this method only work to those who’s not faking / forging their referer)

And of course there’s downside when using this method which is already explained here :

The problem, of course, is that Coral runs on port 8090, and how many people will be blocked from that?

But i think it is still better than you got suspended by your host because your site causing high load on their server (if you’re using shared hosting) :D

Comment?

Note: Comment may not appear right away.