PLEASE help us help you by writing a good post!
- we need to know your netlify site name. Example:
I have two React webapps that I host on netlify. The first one we can say is prod, (https://friendly-dasik-a8ea42.netlify.app/), the second one we can say is beta/staging, (https://nimble-trifle-f2587c.netlify.app/).
I would like when I click on a link on the prod webapp to redirect me to the second one. However when I click on the link to /beta it does not redirect me to the beta site (I use react router). I need to directly access the site by pasting the /beta url to the address box and hit enter to go to it and have the redirect be active.
I’d also like if the beta site doesn’t have beta in the url to redirect me back to the prod site. I am having trouble coming up with a redirect rule to cover this case.
Is this possible?
- DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
- Build problems? Link or paste the FULL build log & build settings screenshot
The better the post - the faster the answer.
prod redirect rule:
# http and https need separate rules if you don’t force_ssl! https://friendly-dasik-a8ea42.netlify.app/beta/* https://nimble-trifle-f2587c.netlify.app/beta/:splat 301! /* /index.html 200
staging redirect rule:
https://nimble-trifle-f2587c.netlify.app/beta/* index.html 301! https://nimble-trifle-f2587c.netlify.app/* https://friendly-dasik-a8ea42.netlify.app/:splat 200
The reasoning behind this is that we want to have two separate repos to rebuild an app and have both of them be live and working with each other. Is there just another better way to do this?