Forum: Ruby on Rails Multiple domains

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,
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.