I’m trying to solve a problem in my current app, we just have released the app with another name and trying to redirect our existing/new users to the newer domain. For this we have altered
_redirect file and add a redirection rule which is something like this
its working as expected for the
/ (root) request. Forexample if someone access
https://olderdomain.com he gets redirected to
https://newerdomain.com the probelm happens when someone tries to access any page other than root…
https://olderdomain.com/signup lands the user on
https://newerdomain.com/signup I want my user to land on
https://newerdomain.com notice the missing /signup part, I do not need it there. Can someone please guide me whats wrong with my redirection rule? Is there anything I can do to achieve the expected behavior?
Hi @tahaahmed, thanks for posting and welcome.
Kindly try the code below in the redirects file to see if it works.
Let me know the outcome.
Hi @clarnx, unfortunately the proposed solution didn’t work. Its still producing the same result i.e. olderdomain.com/custom-page tries to redirect me to newerDomain.com/custom-page.
Any further help to resolve this issue would be highly appreciated
Hi @tahaahmed, thanks for the feedback.
Kindly try the below.
https://olderdomain.com/* https://newerdomain.com/ 301!
Thanks for the quick response @clarnx.
No luck with the redirection code as well. I was wondering if there’s some cache mechanism due to which these changes are not getting reflected? Is there any cache busting mechanism I can try?
If possible can you share a code snippet of your
Also if possible can you share the repository of the old site. It’s possible the
_redirects file is in the wrong location.
What framework are you using on your old site?
Finally make sure the file name is
The content of
https://zir-ai.com/* https://vectara.com/* 301!
The old website is zir-ai.com, _redirects file seem to be in right location. The original content of this file was
Its a create-react-app based project, the prod build is generated and deployed on netlify.
I’ve confirmed the name of the file, its
One important thing I nticed, I changed the content of this
_redirects file to default, its still redirect me from zir-ai.com to vectara.com
Now I can surely say its some caching stuff going on.
Since you originally stated you just want the old site to redirect to the old site and not other URL paths of the old site, kindly edit your current redirects content to the code below.
/* https://vectara.com 301!
Make the changes and let me know the outcome.