[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-26 Thread arai
This might be a good time to mention that with the rails 3 redesign, you can specify much more powerful constraints from within the router. Katz's website has a nice article on it: http://yehudakatz.com/2009/12/26/the-rails-3-router-rack-it-up/ The part I found most interesting was this: Basecamp

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-26 Thread bingo bob
Am I on the right lines ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to r

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-26 Thread bingo bob
Inline - I won't have a chance to test this out until a little later but yes - thanks for this, think I'm getting it. Owain wrote in post #957124: > A quick look and the following points: > > - you are not scoping your property_id to the domain. If you go to > http://chaletcordee.co.uk/propertie

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-26 Thread Owain
A quick look and the following points: - you are not scoping your property_id to the domain. If you go to http://chaletcordee.co.uk/properties/1 you can change to properties 2 in the domain controller and you pick up the other property. Your application controller should set an instance variable

Re: [Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-26 Thread Dhruva Sagar
Oh well if that is the case then you can probably check the current domain / request.url in a before_filter inside application_controller and work accordingly thereafter, that should be simple enough too... -- Thanks & Regards, Dhruva Sagar. On Tue, Oct 26, 2010 at 12:32, bingo bob wrote: > M

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-26 Thread bingo bob
Multiple apps is definitely not what I wish to do here. It's a single app. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com.

Re: [Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-25 Thread Dhruva Sagar
I think you should run different rail apps on different ports and use Nginx to proxy to them. That should be simple enough. -- Thanks & Regards, Dhruva Sagar. On Tue, Oct 26, 2010 at 11:57, bingo bob wrote: > Now I'm firmly back in the rails world here, any kind soul give me a > pointer as to

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-25 Thread bingo bob
Now I'm firmly back in the rails world here, any kind soul give me a pointer as to how I might finish this one. I figure I need to modify the routes file and perhaps conditionally modify the rails app home root based on domain - what else? -- Posted via http://www.ruby-forum.com/. -- You rec

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-25 Thread bingo bob
or to put it another way... what does your routes.rb look like to get the root urls right for a property (in my case properties anyway). also, totally happy to bypass properties controller for the public views, just figured I'd done it the rails way with a properties controller and separate act

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-25 Thread bingo bob
Right - once more unto the breach and all that! Thanks for this, I see what you mean. I've part implemented, the bit I don't quite get relates to finding the relevant property and what I put in the routes file to hook it up (hooking up the default root to a domain/property). The bit you describ

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-25 Thread Owain
I have built something along these lines and here is how it might work for you. Have a domain model that maps a domain name to a property_id(decide whether you are going to use www or no-www (http://no-www.org/) or both if you want but it it is better to choose one or the other for SEO and analyti

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-25 Thread bingo bob
any tips - I'm not certain that I can achieve this with modrewrite. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To uns

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-23 Thread bingo bob
Been trying rewrite stuff all week but can't get to where I want to be. If anyone has an answer or another way - v keen to hear. I did wonder about this...http://github.com/shuber/proxy or my routes.rb file - or more apache tinkering.. this didn't get me there either (lots of repeated stuff here

Re: [Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-20 Thread Walter Lee Davis
Do try it, that's the secret sauce that lets the URL remain masked. The R flag you have there currently is doing a full external redirect to a subfolder, but I don't think you need that. Walter On Oct 20, 2010, at 5:11 PM, bingo bob wrote: Will try [NS,QSA] but from what walter said I thin

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-20 Thread bingo bob
Luis Saffie wrote in post #955491: > Did you try using the flags Walter suggested, [NS,QSA]? Can you post > your Apache rewrite rules? > > Hopefully we're not going too off topic with Apache :-) Sorry for delay, currently running with this ServerName chaletcordee.co.uk ServerAlias www.chal

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-19 Thread Luis Saffie
Did you try using the flags Walter suggested, [NS,QSA]? Can you post your Apache rewrite rules? Hopefully we're not going too off topic with Apache :-) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-19 Thread Marnen Laibow-Koser
Please quote when replying. bingo bob wrote in post #955467: > Well in my case I need to do two things. > > 1) redirect www.foo.com => www.foo.com/properties/1/ > DONE > > 2) rewrite the resulting url www.foo.com/properties/1/ => www.foo.com > NOT DONE YET > > I'm clear point 1 should be done in A

Re: [Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-19 Thread Walter Lee Davis
You can get www.foo.com/ to display the content of properties/1 by setting your route for "root" in your routes.rb file. In Rails 2, this would be map.root :controller => :properties, :action => :view, :id => 1 Now if you are trying to make property1.foo.com point there as well, that could

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-19 Thread bingo bob
Well in my case I need to do two things. 1) redirect www.foo.com => www.foo.com/properties/1/ DONE 2) rewrite the resulting url www.foo.com/properties/1/ => www.foo.com NOT DONE YET I'm clear point 1 should be done in Apache config, as it is. Are you saying point (2) should be done in Apache or

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-19 Thread Marnen Laibow-Koser
bingo bob wrote in post #955373: > Thanks Luis, I'll refer to them and see if I can find a solution totally > via apache/modrewrite; I suspect I can! I need to get a handle on the > syntax of those rewrite commands, the command chain and regexes, should > be ok. I'll post back to this thread with t

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-19 Thread bingo bob
Thanks Luis, I'll refer to them and see if I can find a solution totally via apache/modrewrite; I suspect I can! I need to get a handle on the syntax of those rewrite commands, the command chain and regexes, should be ok. I'll post back to this thread with the solution when I crack it. You need to

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread Luis Saffie
You could do it all with modrewrite. You'll just need to specify the specific rules and rewrite actions for all your cases. It's not that hard, just read up on it. There are countless of resources on the web about this. Here's a starting point http://www.webmastertips.us/tutorials/mod_rewrite.ht

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread bingo bob
Anyone else comment as to if this combination of apache rewrites and rails routing will play nicely together. I'll try it of course just imagine that it may have been done before by somebody. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread Luis Saffie
yes, it should work. Look like you may need to add single resources along with the nested ones. Not entirely sure if you can do this though... Luis -- http://www.saffie.ca -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread bingo bob
I'm half way there then? Need to handle the rest on the rails side - via my routes.rb file? Will this approach work? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread bingo bob
So taking it a step on I figure I need to work on a few things... need to make sure www versions all operate ok. need to make sure that when I add another domain, that works to. http://chaletcordee.co.uk/properties/1/comments should be http://chaletcordee.co.uk/comments guess this is the rails

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread bingo bob
Thanks for bearing with me. That one didn't work - close but it gave me a double rendering of the apartment-marie.com bit, something like this... apartment-marie.com/apartment-marie.com/properties bla... so I edited like so (here's the real file and it's live if it helps).. This is much better

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread Luis Saffie
Ok, let's back up a bit. For now just do the apache rewrite as I mentioned above. I think Fred is right that you need to use ^/$ rather than ^.*$ so your rule would look like RewriteRule ^/$ apartment-marie.com/properties/2/$1 [R] I think that's it. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread bingo bob
totally lost. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-t

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread Luis Saffie
As Fred metioned. Looks like there's two rewrites here. Only needs to be done from the Apache side and the other from rails (routes.rb) I suggest you get the apache site going before attempting the other rewrite. Luis -- http://www.saffie.ca -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread Frederick Cheung
On Oct 18, 2:43 pm, bingo bob wrote: > Hi Luis, > > Thanks for this, I'm getting *really* close I think. > > That looks fine and I've tried - the redirects are taking effect but > it's not quite right. > > The localhost:3000 part was just on my Mac, now I'm on the server I need > to replace that

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread bingo bob
Hi Luis, Thanks for this, I'm getting *really* close I think. That looks fine and I've tried - the redirects are taking effect but it's not quite right. The localhost:3000 part was just on my Mac, now I'm on the server I need to replace that in some way with the root of the rails app - how do

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread Luis Saffie
Yeah, for this setup it's recommended to use virtual hosts along with modrewrite So for example you'd have your site like this defined in your apache.conf ServerName www.chalet-yeti.com RewriteEngine on RewriteRule ^(.*)$ http://localhost:3000/properties/1/$1 [R] ServerName www.apar

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread bingo bob
Someone's suggested that actually using virtual hosts maybe a better way for me to do this? Thoughts? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyon

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-18 Thread bingo bob
Thanks for this. I'm about to try and implement it, appreciate this is a little OT, but has anyone got any more tips for me or even a quick example. Just to be clear, I'm using passenger - will that get in the way or also need any configuration? -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-16 Thread Luis Saffie
Yes, it will You'll want to use wildcards Luis -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-16 Thread bingo bob
Luis Saffie wrote in post #954771: > You could do this with Apache > Look at modrewrite > > Luis Thanks that's great. Will it have the flexibility to deal with all the sub pages? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Gr

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-16 Thread Luis Saffie
You could do this with Apache Look at modrewrite Luis -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from

[Rails] Re: multiple domain names mapping to different rails app URLs

2010-10-16 Thread bingo bob
Anyone done anything like this before? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, sen