DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Slashdot Protection

04.23.2006
| 5634 views |
  • submit to reddit
        Replace aaa.bbb.ccc.ddd with your own IP (so you always get to your site).
Replace www.yourdomain.com with your actual domain.

Just don’t mess with the user_agent and query_string lines. Those ensure that the Coral servers themselves can retrieve your page when they need to.

(Shamelessly stolen from http://ottodestruct.com/diggprotectionrules.txt)

RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^aaa.bbb.ccc.ddd$
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\.)?engadget\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?boingboing\.net [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?del\.icio\.us
RewriteRule ^(.*)$ http://www.yourdomain.com.nyud.net:8080$1 [R,L]