_redirects file help

Hi all,

Having issue setting up _redirects file. Hoping someone can offer some help, thank you in advance for the time.

Netlify domain configuration:

And here’s my _redirects file (located in the build directory, which is my publishing directory):

# Redirect domain aliases to primary domain
https://yogamusiq.com/* https://beta.yogamusiq.com/:splat 301!
https://www.yogamusiq.com/* https://beta.yogamusiq.com/:splat 301!

# Optional: Redirect default Netlify subdomain to primary domain
https://yogamusiq.netlify.com/* https://beta.yogamusiq.com/:splat 301!

Please let me know if anything else is needed, thank you!

are your redirects getting processed at all? it should say in the UI after you publish a deploy.

Thanks for the reply @perry. In the most recent deploy, I see “No redirect rules processed.” I can confirm the _redirects file in our Github repository.

Hi, @Bharwcb, I’m seeing this in the deploy logs:

3:15:01 AM: Starting to deploy site from 'build/'

This site has a publish directory set (which is build/ as can be seen above). The _redirects file needs to be copied here during the build. This can be done by making the build command the one below:

npm run build && cp _redirects build/

The “&&” is a “logical and” which only proceeds to the next step (copying the redirects) if the build itself was successful. If “;” is used instead, it would mean even failed runs of npm run build would be published. The && is very important to prevent the publishing of failed builds.

Would you please try changing your build command to that and let us know it if resolves the issue?