0

I want to achieve that https://domainA.com/folder shows the content of https://domainB.com without redirecting the user to domainB.

So it is important, that a user visiting domainA.com/subfolder remains on domainA but sees the content of domainB.

Brotzka
  • 2,959
  • 4
  • 35
  • 56
  • Is that `https://domainA.com/folder` or `https://domainA.com/folder/`? The trailing slash does matter. – Ivan Shatsky May 13 '22 at 18:49
  • Both options may be relevant. So for example, if the user visits domainA.com/folder/pageA, the content he should see would be domainB.com/pageA. So ideally no matter what comes after domainA.com/folder should be mapped to domainA.com. – Brotzka May 13 '22 at 21:33
  • @IvanShatsky is this possible? – Brotzka May 16 '22 at 07:56
  • 1
    It is a tricky thing depending on what kind of content that `domainB.com` actually serves. See [this](https://serverfault.com/a/932636/498657) answer for some kind of general consideration and [this](https://stackoverflow.com/a/70012067/7121513) one for some additional details. – Ivan Shatsky May 16 '22 at 08:05
  • @IvanShatsky by now it's a single page application using hash-urls (Vue-App). So it uses urls like https://domainB.com/#/sub/page. But there is also a php backend behind the single page application serving as api backend – Brotzka May 16 '22 at 09:50
  • SPA apps (for example a react one using `HashRouter` rather than `BrowserRouter`) are the only kind that can use the trick I discovered once and described [here](https://stackoverflow.com/a/62840133/7121513) (see the second answer option), for every other app it will break the routing. I think the API should work correctly too. Even if it isn't, it should be possible to add an extra location to the nginx config to allow that API work. – Ivan Shatsky May 16 '22 at 10:18

0 Answers0