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…
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…
http://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-original_url
request.original_url # => “http://www.example.com/articles?page=2”
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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs