V
V
Viktor Taran2019-08-30 16:04:37
Nginx
Viktor Taran, 2019-08-30 16:04:37

How to host two sites on the same domain, or a knight's move?

The task is rather strange, but the customers are too specific
, and so
there is an old site that does not want to move out of the domain and a new
site with grief has taken A record on its server
The task in the next
old site.
Korchoe as if two sites are in one place and at 404 the old site is accessed and the content opens
And so we
decided to do it simply in 404.php to put a proxy that accesses the old IP passes authorization and opens the site.
And it even works
But static content is naturally given already from the local machine, including css, since naturally on the old domain they are accessed through the domain.
At the moment, there is an idea to tie some kind of crutch in nginx location with statics
. Or, as an option to make a knight's move through try_files
, can there be something more acceptable?
Moving static content to a new site isn't an option either.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor, 2019-08-30
@shambler81

Place the old site in the old folder. With a targeted hit in 404, you redirect to the original path, but to the old folder.

V
Viktor Taran, 2019-08-31
@shambler81

Thank you all made it quite easy. proxy php, replace urls with static
and on the back site with www with an exception in the redirect to the main mirror for a specific ip.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question