How to configure react app with a router and docusaurus app on the /docs path


I have two netlify apps building two different static apps,

One is a create-react-app that uses react-router and the other is a docusaurus static app.

So in a nutshell: # React App # React App # Redirect to docusaurus netlify app # docusaurus app with its own router

The react app netlify.toml is as follows

  from = "/docs"
  to = ""
  status = 200

# Redirect to / so react-router works.
  from = "/*"
  to = "/"
  status = 200

I want to host my docusaurus site on however when i set the baseUrl to /docs my site is rendered but the assets do not load and the docusaurus router does not work.

Am I doing this the best way?

Hey @karltaylor,
Yup, this looks like the right pattern :slight_smile: It’s similar to this one:

For the baseUrl for your docs site config, I would start with / as described in the Docusaurus docs.

As for your redirect rules, your first one will likely need a * and :splat:

  from = "/docs/*"
  to = ""
  status = 200!

And the second one might need to be to = "/index.html".

Want to give this all a try and let us know if it works for you?