About

You’re visiting the personal website of Joost Schuttelaar.

Take a look

Contact

You can e-mail me at jelephants @ jstsch.com (anti-spam: please remove the mammal with the big snout).

Twitter feed @jstsch

Sorry, feed is gone. API has been killed by Twitter.

Recent posts

Go dark to fight SOPA with a simple .htaccess rewriterule

Sunday January 15 2012

Simple piece of code to put in your .htaccess if you want to join in the protest against SOPA:

# RewriteEngine on (enable if you don't have it yet)
RewriteCond %{TIME_YEAR}%{TIME_MON}%{TIME_DAY} ^20120118$
RewriteCond %{TIME_HOUR} >7
RewriteCond %{TIME_HOUR} <20
RewriteRule ^(.*)$ http://reddit.com/r/sopa [L]

This will redirect any request, to your protest site of choice on Jan 18th, between 08:00 and 20:00 (local webserver time). Assuming Apache of course!

Comments

Nick @ Sunday January 15 2012 17:22
So this redirects your site to reddit.com/r/sopa? Isn't Reddit participating? They will lave /r/sopa up?
jstsch @ Sunday January 15 2012 21:32
Yes, you're right. Probably not the best URL to redirect to. Would be good to put up a generic 'this site went down to protest sopa' page somewhere.
littlebearz @ Wednesday January 18 2012 08:32
using it now, hm.. wonder if reddit is good

(never shown, not required)
(not required)