Skip to content

Instantly share code, notes, and snippets.

@pheisiph
Created March 20, 2014 09:36
Show Gist options
  • Save pheisiph/9660277 to your computer and use it in GitHub Desktop.
Save pheisiph/9660277 to your computer and use it in GitHub Desktop.
Redirect all requests to new domain
require 'rack/rewrite'
use Rack::Rewrite do
r301 %r{/(.*)}, 'https://somewhere.else.website/$1'
end
run lambda { |env| [200, {"Content-Type" => "text/plain"}, ["You shouldn't get here."]] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment