Multiple domains

25 views
Skip to first unread message

McHenry

unread,
Aug 20, 2014, 12:14:05 AM8/20/14
to rubyonra...@googlegroups.com
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...

Robert Walker

unread,
Aug 20, 2014, 9:33:58 AM8/20/14
to rubyonra...@googlegroups.com

Christian Kruse

unread,
Aug 21, 2014, 4:39:00 AM8/21/14
to rubyonra...@googlegroups.com
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,

--
Christian Kruse
http://ck.kennt-wayne.de/
Reply all
Reply to author
Forward
0 new messages