Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails plugin to handle conditional routing based on hostname (or port)
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
rails
README.md
init.rb

README.md

Host Router

Rails plugin to create routes based on HTTP_HOST (or HTTP_PORT).

Installation

./script/plugin install git://github.com/itspriddle/host_router.git

Usage

# Only available for http://abc.example.com/some/path
map.connect '/some/path',
  :controller => 'somecontroller',
  :conditions => { :host => 'abc.example.com' }

# Available for any site routing to your app, on port 1234
map.connect '/some/path',
  :controller => 'othercontroller',
  :conditions => { :port => '1234' }
Something went wrong with that request. Please try again.