A
A
Alexander Petrov2016-05-20 20:02:00
Ruby on Rails
Alexander Petrov, 2016-05-20 20:02:00

How to determine from which domain a site was opened?

The site opens from two different domains. It is necessary to determine in the controller from which domain the site was opened and, depending on this, open a specific view. Perhaps it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Minisol, 2016-05-20
@Mirkom63

Use either request.env["SERVER_ADDR"]orrequest.env['HTTP_HOST']

N
N. Bekseitov, 2016-05-20
@nbekseitov

request.host

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question