On the main website I have a redirect set in the netlify.toml
[[redirects]]
from="/gameroom/wtf/*"
to = "https://wtf-lmey.netlify.app/:splat"
status = 200
I need the URL in the address bar to remain unchanged, but the detail website should be served.
The redirect is working and the URL remains the same. However, the page that is living on the second URL is not working properly.
It returns several 404 on images, .js files and so on. Only the static HTML is rendered. If I visit the second website directly, everything works just fine.
Everything works when you visit https://wtf-lmey.netlify.app directly, but not when proxying via https://entertainyou.netlify.app/gameroom/wtf/ because (by default) Nuxt builds a site thinking visitors will access it via the domain root (/.) As you wish to access it via a different path (/gameroom/wtf/) you would need to change the base directory for the production site.
This has the downside of the site no longer working at the root of the domain i.e. Rather than accessing it via https://wtf-lmey.netlify.app it would live at https://wtf-lmey.netlify.app/gameroom/wtf/ too. This is fine if you don’t want anyone directly accessing the site via this domain.
When you load the site hosted at https://wtf-lmey.netlify.app/ from your main site via https://entertainyou.netlify.app/gameroom/wtf/ the issue is that images and other assets won’t load. This is because all path such as
become relative to the main site https://entertainyou.netlify.app/WTF_welcome.jpg not the second site https://wtf-lmey.netlify.app/WTF_welcome.jpg. This is why requests to these assets show as 404 Not Found