Having Issue with a redirect

We are having issues pointing a subdomain to the right place.

Our website is [example].com and we have a page on the site at [example].com/_sites/page. We wanted to have that page load when a user visits page.example.com. Because we wanted to test this all out before pushing to production, we used [example].dev instead of example.com so this was being pushed to an entirely different domain.

  1. We added a _redirect file in the root of our website.
https://page.example.dev/ /_sites/page 200!
  1. We added a new domain to our domains on netlify page.[example].com

  2. We then added a DNS CName record on our cloudflare
    Value: apex-loadbalancer.netlify.com

The configuration worked. Now we are trying to apply the same setup to example.com, so we followed the same steps and we are getting page not found and we aren’t sure why. The site builds but the redirect isn’t working. We tried moving the redirect file to our public folder and that didn’t help. We noticed that example.com was using netlifyDNS and example.dev wasn’t so we removed it form netlifyDNS and that didn’t change anything.

Any help on this would be appreciated

hi there, before we dig in, did you see this guide on debugging redirects?

I strongly suggest you give it a thorough read through and see if this fixes your problem:

if not, please post again, and we’ll try and troubleshoot.

Hi, Sam.

Yes we did take a look and we weren’t able to fix the issue. The thing is it’s working on a site with the same configuration but not on this one for some reason.

Solved. It was an issue with a line of code on our side that was forcing us to use a specific subdomain.

Thanks for coming back and confirming you solved your issue as well as providing the solution to the community. Best of luck. ( :