Advertisement
Guest User

Untitled

a guest
Jan 10th, 2012
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.44 KB | None | 0 0
  1. use Rack::Static,
  2.   :urls => ["/style"],
  3.   :root => "public"
  4.  
  5. run lambda { |env|
  6.   [
  7.     200,
  8.     {
  9.       'Content-Type'  => 'text/html',
  10.       'Cache-Control' => 'public, max-age=86400'
  11.     },
  12.     File.open('public/index.html', File::RDONLY)
  13.   ]
  14. }
  15.  
  16. use Rack::Rewrite do
  17.   r301 %r{.*}, 'http://www.domain.com$&', :if => Proc.new {|rack_env|
  18.     rack_env['SERVER_NAME'] != 'www.domain.com'
  19.   }
  20. end if Rails.env == 'production'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement