On Feb 9, 2011, at 0:33 , Fima Leshinsky wrote: > That seems very odd. How does Radiant know which site you're > requesting? In your examples, the browser wouldn't send an HTTP Host > header which is really the only way to differentiate between site A > and site B at the HTTP level. Also localhost is just an entry in your > /etc/hosts file (assuming you're on a un*x-based system), which by > default is configured to resolve to 127.0.0.1. Since Radiant only sees > HTTP - both of those requests would appear identical to it. > > In my case - Radiant is serving up the default site regardless of what > Host header it sees. > > Do I need to make a change somewhere else to add new sites using the > vhost extension? > > Interesting that the Site model doesn't contain a hostname field. > Where is the hostname of each site specified? > > Site.find_each {|s| p s} > #<Site id: 1, config: {"title"=>"Default"}> > #<Site id: 2, config: {"title"=>"Effective Web Presence"}>
Dig into the models. A site has_many :hostnames https://github.com/saturnflyer/radiant-vhost-extension/blob/master/app/models/site.rb Setup your sites with differing hostnames and then open different browser windows and request them. This works just fine for me. > > Thanks again! > >> It depends on what you've setup. >> >> I'll often (in development) set one site to be "localhost" and another to >> "0.0.0.0" and another to "127.0.0.1" >> All of those point back to your internal webserver and Radiant can answer >> for 3 different sites. >> >> Does that help? >> >> -Jim