B
B
blabs2016-12-17 21:44:43
PHP
blabs, 2016-12-17 21:44:43

How to redirect without changing URL?

How can I redirect from one domain to another without changing the URL?
You need to set up a redirect from the addresses:
https://u.domain.com/(.*)
to
https://apitest.domain.com/u/$1
so that the URL in the address bar does not change.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg, 2016-12-17
@politon

iframe?

S
Stepan, 2016-12-17
@steff

Something like this:

if ($host ~* ^u.domain.com\.(.*)$) {
  rewrite / https://apitest.domain.com/u/$request_uri permanent;
}

C
ckr, 2016-12-28
@ckr

You need to do a 302 redirect (temporary).
The browser will load another URL while leaving the old one displayed.
True, it is possible that this will not work cross-domain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question