Preparing a Site for SOPA Blackout with .htaccess

BorkWeb, like a number of other sites, will be going black this Wednesday as a protest to SOPA.  Legends of the Sun Pig has an excellent article on this exact topic.  Martin writes:

Google recommends using HTTP 503 “Service Unavailable” status codes. The 503 code indicates that the service (or page, or site) is temporarily unavailable, but that it is expected back again soon. This is better than using the 404 (not found), 302 ( moved temporarily), or 301 (moved permanently) codes, because it tells web crawlers that they should just come back and try again later.

Because I have no desire to manually make the cut-over to a SOPA Blackout .htaccess file at midnight (because I’m lazy), I took his .htaccess settings and made a modification to enable the settings for the tomorrow.  Here’s what I have:

<IfModule mod_rewrite.c>

# =====================
# SOPA Blackout
# =====================

# Set a custom error document for 503 errors
ErrorDocument 503 /503_sopa.html

# Cause all requests (except images) to generate a 503 error,
# which will produce the custom 503 error document
RewriteEngine on
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} !=503
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteCond %{REQUEST_URI} !robots\.txt$ [NC]
RewriteCond %{TIME_YEAR} ^2012
RewriteCond %{TIME_MON} ^01
RewriteCond %{TIME_DAY} ^18
RewriteRule ^ - [L,R=503]

# =====================
# NOT SOPA Blackout
# =====================

# My other rewrite magic goes here.
</IfModule>

Additionally, I’ve shamelessly stolen the php.net SOPA 503 page because it is awesome.

Dreamhost and Inept LA Utilities

I own a whole boat load of domains (as I have stated in my GoDaddy Addiction article) and the hosting service I go through is Dreamhost and I must say they are by far the best hosting service I have come across…I’ve jumped around a lot over the years trying to find a host that was fairly reliable, had a good administration user interface, and had fairly prompt customer support. Dreamhost is it.

Well, my opinion of them soured every so slightly yesterday when I was unable to reach any of my sites or any of my friend’s sites that are hosted at Dreamhost…for about 5 hours. Heck, even the front Dreamhost site was down at the same time. Obviously something went horribly wrong as Dreamhost had not sent out a ‘planned down time’ e-mail as they usually do. Ok, sure, I’m fairly forgiving when things go wrong, but when Dreamhost did not send out a reason as to why their services were down (as they usually do), I became somewhat irritated. Perhaps I’m too touchy when it comes to that sort of thing, but when a hosting service holds all of my data and source for hundreds and hundreds of hours of time and effort…a little feed back would be a good thing.

A couple of minutes ago, my irritation was put to rest. It wasn’t Dreamhost’s fault. It seems that the Los Angeles Department of Water and Power had a slip up that caused large portions of LA to lose power for upwards of five hours. Here’s the article at LA Times which I found over at LAVoice.org.

So thats a big hooray for skill of Toluca Lake’s workers and a big apology to Dreamhost. I suppose if I watched the news a little more diligently, I would have known…granted, some communication after the fact would have been nice to see.