Help with rewrites/deploying multiple repos in single site


I am limited to 4 links here as a new user so I’m purposefully making some of these links not work so I can post. I’m not sure whether my issue today has anything specific to do with the fact that I’m using two Hugo sites, as I was able to successfully do a 200 rewrite from this netlify site (rmarkdown-docs.netlify-dot-com) to this url just fine: rmarkdown.rstudio-dot-com/docs/

Here are the four relevant links:

  1. My primary site:
  2. My secondary site:
  3. A rewrite from the first to the second that fails:

I have a custom domain associated with an existing Hugo site deployed via Netlify, and would like to have a rewrite redirect that directs users to another existing Hugo site deployed via Netlify (same team). The rewrite redirect bit is critical for me- I do not want users to ever be exposed to the * url in their browser.

Here is an example test from my redirects file:

/medicine/* 200!

This rewrite results in broken assets in the secondary site when left “as is”. I can fix this in the rewritten link by changing the baseurl in my secondary site, but this change breaks the linking of the assets in the netlify site. Can I have both just work using a rewrite redirect? I would like to change actual code and Hugo layouts in the secondary site as little as possible for this work.

Any ideas?

Thank you!

Hello @apreshill, can you clarify which netlify site the ‘change breaks the linking of the assets’ of and in what way? You could try creating a redirect rule on the second netlify site to the broken links where they need to go but without more information, it’s hard to provide a more detailed advice.