Created
June 5, 2010 17:22
-
-
Save jfernandez/426802 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rack-rewrite' | |
DOMAIN = 'www.production-hacks.com' | |
# Redirect to the www version of the domain in production | |
use Rack::Rewrite do | |
r301 %r{.*}, "http://#{DOMAIN}$&", :if => Proc.new {|rack_env| | |
rack_env['SERVER_NAME'] != DOMAIN && ENV['RACK_ENV'] == "production" | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment