Skip to content

Instantly share code, notes, and snippets.

@nirix
Created July 21, 2011 17:44
Show Gist options
  • Save nirix/1097737 to your computer and use it in GitHub Desktop.
Save nirix/1097737 to your computer and use it in GitHub Desktop.
Routing subdomains in Ramaze
Domains = {
/domain\.com/ => '/',
/forum\.domain\.com/ => '/forum/index'
}
Ramaze::Route['sub domains'] = lambda do |uri, action|
Domains.each do |regex, sub_uri|
if action['env']['HTTP_HOST'] =~ regex
return sub_uri
end
end
return uri
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment