I am trying to implement a redirect from the Netlify subdomain to custom primary domain for my website built with Gatsby.
Netlify subdomain: optimistic-bhaskara-b7453a
Here are rules that figure in my _redirects file that is in the static folder of my Gatsby project.
# Redirect default Netlify subdomain to primary domain https://optimistic-bhaskara-b7453a.netlify.com/* https://www.meetstargazers.com/:splat 301! # Redirect dynamically created page /resetpassword/* /resetpassword/index.html 200
Expected result : Redirect from Netlify subdomain to custom primary domain.
Actual result : Redirect doesn’t work.
I have tried the following :
- Moving the _redirects file from static folder to root of the project.
- Changing the order of the rules within the _redirects file.
- Different syntaxes for the redirect rule.
- Emptying the cache in Netlify and redeploying the project.
What is strange is that the redirect rule for the dynamically generated page /resetpassword/:id works perfectly.
Can anyone please help me to solve this problem ? This is important for me to not be punished by Google for duplicate content.