-
-
Save awebneck/1142324 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
The goal is for any url elaposentoalto.upperroom.org/abc to be redirected to elaposentoalto.upperroom.org/es/abc | |
The following correctly redirects elaposentoalto.upperroom.org to elaposentoalto.upperroom.org/es, and it correctly leaves elaposentoalto.upperroom.org/es alone. | |
However, it incorrectly redirects elaposentoalto.upperroom.org/es/devotional to elaposentoalto.upperroom.org/es/es/devotional. | |
with_es_subdomains = ['elaposentoalto'] | |
with_es_subdomains.each do |subdomain| | |
match "" => redirect("/es"), :constraints => { :subdomain => subdomain } | |
match "/*rest" => redirect("/es/%{rest}"), :constraints => lambda{ |req| req.host =~ /^#{subdomain}\./ && !(req.env["REQUEST_URI"] =~ /^es/) } "rentals" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment