Netlify Internal Redirect not showing current destination

We’re trying to configured a Netlify Internal Redirect that looks like this:

/pals/join/:splat https://pal-signup-web.netlify.app/pals/join/:splat 200

This appears to work until we deploy code changes to the destination site - the changes aren’t appearing. They’re appearing if we visit the destination site directly, though.

Source site (with redirect enabled): https://www.joinpapa.com/pals/join

Is it acquiring the assets from the source site (the destination is currently a copy of the source app)? If so, is there a best way to redirect for these as well?

Hi @dminer

A 200 redirect returns the destination content without changing the URL/path shown in the browser address bar.

If you wish to change the visible address, you will need to either redirect with a 301 or 302

Thanks for the reply @coelmay, but an internal redirect is what I want. It’s redirecting to the destination correctly, but the destination is getting its assets (in this case, css files) from the original site; my goal is to make the destination React app get its css files from itself instead of the app it was “internally redirected” from.

Just noticed the rule

is not correct.
Should read

/pals/join/* https://pal-signup-web.netlify.app/pals/join/:splat 200

However I shall add:

When using a proxy, the page/site proxies to (in this case /pals/join) becomes a path of the site proxied from, such that any asset (images, stylesheets, scripts) are loaded from the site proxied from, not the site proxied too.

So if the page pal-signup-web.netlify.app/pals/join/ has an asset /styles/main.css and this page is accessed via a proxy at joinpapa.com/pals/join/ then the /styles/main.css is loaded from joinpapa.com not pal-signup-web.netlify.app because that is where the page is accessed. The result in many instances is missing styles, images, etc. One method to get around this is to add <base> to the site proxied to so that all assets load from the original domain.

I do note that pal-signup-web.netlify.app has <base> set, but it is to a preview URL e.g. https://XxXxXxXxXxXxXxX--pal-signup-web.netlify.app/pals/join instead of pal-signup-web.netlify.app.

1 Like

This was it; things started to come together once we fixed the redirect rule like you suggested. Thank you @coelmay!!

1 Like