Forum: Ruby on Rails Multiple domains

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Be8e74e9eeb89d4b0a35dcc80117f3eb?d=identicon&s=25 McHenry (Guest)
on 2014-08-20 06:15
(Received via mailing list)
I am proposing to have multiple domain name pointing towards a single
site.

On the site I would like to display the domains name that was used.

How can I obtain the name of the domain that the user entered to access
my
site?

Thanks in advance...
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2014-08-20 15:33
7945ab8fcdf17ebe1dcd3a415df316c0?d=identicon&s=25 Christian Kruse (Guest)
on 2014-08-21 10:39
(Received via mailing list)
Hi,

On 19/08/14 21:14, McHenry wrote:
> On the site I would like to display the domains name that was used.
> How can I obtain the name of the domain that the user entered to
> access my site?

„used“ as in „supplied by the browser?“ One could forge a request with
Host header set to 'example.com' and connect to localhost, thus the
question. If the header value is the thing you're looking for: it is
contained in `request.host`.

Best regards,
This topic is locked and can not be replied to.