Skip to content

Instantly share code, notes, and snippets.

@daniel-nelson
Created August 12, 2011 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save daniel-nelson/1142360 to your computer and use it in GitHub Desktop.
Save daniel-nelson/1142360 to your computer and use it in GitHub Desktop.
no_es_subdomains = ['devotional']
no_es_subdomains.each do |subdomain|
match "/es" => redirect(""), :constraints => { :subdomain => subdomain }
match "/es/*path" => redirect("/%{path}"), :constraints => lambda{ |req| req.host =~ /^#{subdomain}\./ && !(req.env["REQUEST_URI"] =~ /^es/) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment