Need help with rewrite via _reredirects file for https://coronatimemap.netlify.app

I am trying to learn how to make rewrites from one site to multiple netlify apps, as instructed in [Common Issue] Can I deploy multiple repositories in a single site?

The redirect rule works with following config(_redirects file):
/barchart https://coronachart.netlify.app/barchart

However, when I try to change this to
/barchart/* https://coronachart.netlify.app/barchart/:splat 200

It doe not quite work. The goal is to have
https://covidtimemap.netlify.app/barchart —Rewrite --> https://coronachart.netlify.app/barchart/ so I can deploy them separately. This is just a test project before I try to link assets such as /blogs

Another question is whether we are required to use the toml file for rewrite rules or this is possible with _redirects file, it’s unclear with the official community post on the topic.

Howdy and sorry to hear about the trouble!

Last question first: You can use either netlify.toml or _redirects for redirects; both work :slight_smile:

That site (coronatimemap.netlify.app) currently has no redirects deployed, so none would be in effect.

Could you tell me how you are trying to add them? I don’t see a netlify.toml NOR _redirects file in your current deploy on that site. The rule you mention should work fine:

/barchart/* https://coronachart.netlify.app/barchart/:splat 200

…assuming you have no content under /barchart on coronatimemap, which you do not currently.

Since redirects are deploy-specific, perhaps you could link me to an older deploys’ logs in our admin UI (picking from here: https://app.netlify.com/sites/coronatimemap/deploys) that you think had that redirect so I can examine what happened with that deploy?

Note that _redirects needs to be next to index.html in the publish directory :slight_smile:

Yeah, the redirects was not there 'cause it was not working at the time. I added it again if you want to investigate the file content.
I was actually trying it out on https://covidtimemap.netlify.app/, which is why you did not see the logs.

@fool I updated my _redirects to be following:
/barchart https://coronachart.netlify.app/barchart
/barchart2/* https://coronachart.netlify.app/barchart/:splat 200
/barchart3/* https://coronachart.netlify.app/:splat 200
/barchart4 https://coronachart.netlify.app 200

Only first one works at the moment, and it is a redirect rule, not rewrite.

Hi, @coronatimemap.com. I replied to you about this in a ticket opened for this issue as well.

To summarize the answer there, I do see the redirects working. The page doesn’t display because of the links in the HTML are absolute (instead of relative). This means when it is proxied to other page resources referenced in the HTML are 404s. Using relative links for assets in the proxied to HTML will resolve the issue.

If there are other questions about this, please let us know.