Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For the coming up SOPA blackout, I plan to shut down all of my websites. I'm not sure how to do this though! How do I make every web request made on any of my pages redirect to the same file? Any idea?

share|improve this question
Are you planning a full shutdown (as I am for my personal site)? For sites where that's not feasible consider using the script from (you can copy it locally if desired to avoid the risks inherent in calling a script from an external domain...) – voretaq7 Jan 13 '12 at 22:54

In the server or vhost context (if you use .htaccess or directory context, drop the leading slashes):

RewriteEngine On
RewriteRule !^/sopa\.html$ /sopa.html [R,L]

This'll send a redirect (302) response for every page to the sopa.html page. Alternatively, you could return the sopa.html content for every request without redirecting, but I suspect this approach is better with regard to search engine reindexing.

share|improve this answer
Note that you should be certain whatever method you use issue a 302 redirect ("Found:" -- temporary), not a 301 (Moved. Permanent.) to avoid upsetting search engines. 302 is the default in Apache (I believe all versions) but can be explicitly specified as R=302 if you're paranoid. – voretaq7 Jan 13 '12 at 22:48

Google do not recommend using 302 for such protest message or maintenance page as this might affect ranking.

Here is how I do 503 error pages which is human readable as well:

RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} !=503
Alias /stop-sopa /var/www/stop-sopa
ErrorDocument 503 /stop-sopa/index.html
RewriteRule !^s/stop-sopa$ /stop-sopa [L,R=503]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.