Redirects not working for second site

Hello,

I’m having difficulty getting redirects to work properly on one of our sites: be-splash-web (https://be-splash-web.netlify.app/).

We currently have two “separate” Netlify sites, but they share the same repository and _redirects file:

The be-splash-web site was recently created with the goal of being able to support vanity URLs (custom pages backed by domain aliases with “rewrite” redirects). Currently, the DNS, Primary domain and a couple Domain Aliases have been configured on the site. I checked the latest deployment and did not see any errors and the _redirects file from the deployment contains the following redirects that aren’t working:

https://bromtg.com/abc https://bromtg.com/community-care/abc-community 200
https://bromtg.com/* https://bromtg.com/community-care/:splat 200
https://brothersmtg.com/dev https://bromtg.com/adam-boles 200
https://brothersmtg.com/* https://bromtg.com/bolesgroup 200

Any insight would be greatly appreciated.

Thanks,
-Ken

hi there, before we dig in, did you see this brand new 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.

Does adding force that is 200! make a difference?

Hi Perry,

I did read through the new guide yesterday and didn’t see any changes that would resolve the issue. Granted, I could’ve missed something, but I did read through it.

Is replying good enough or do you really want me to post the same topic again?

Thanks,
-Ken

Hey Ken!

As @hrishikesh has advised, can you change the 200 to 200! please? Because the page already exists on the originating site, the ! ensures that – despite the content already existing – we’ll attempt the proxy.

Thanks!

Hi Pie,

I added the exclamation (200!), but no change in behavior; they’re still not working.

Thanks,
-Ken

Hi, @kyeck. I don’t see this rule in _redirects:

https://bromtg.com/abc https://bromtg.com/community-care/abc-community 200

However, I do see this similar rule:

https://brothersmtg.com/vanitytest-abc-community https://brothersmtg.com/community-care/abc-community 200

I do show that redirect working correctly. Both URLs below:

  • https://brothersmtg.com/vanitytest-abc-community
  • https://brothersmtg.com/community-care/abc-community

show the same content for me.

You can download the deploy to see the _redirects file used in the deploy using the download deploy button in the our web app UI:

download-deploy-button-small

Would you please download the deploy and check the _redirects file to see if we are using the redirects you expect? If you see redirects listed there which are not working, please let us know a rule not working and we will be happy to troubleshoot this issue further.

Hi Luke,

That’s strange. The redirect you say is working was the first and only one added to the _redirects file on 12/8/20. Since then it was removed and the _redirects file has been edited multiple times with these being the latest entries (which should be reflected in latest build/deploys - i.e. 1/4 @ :3:08PM):

https://bromtg.com/abc https://bromtg.com/community-care/abc-community 200!
https://bromtg.com/* https://bromtg.com/community-care/:splat 200!
https://brothersmtg.com/dev https://bromtg.com/adam-boles 200!
https://brothersmtg.com/* https://bromtg.com/bolesgroup 200!

I looked at the files from the latest deploy, and the _redirects file does contain the latest redirects (as listed above) which means the file isn’t being copied for some reason.

It was copying before and nothing has really changed that should affect. Is the deploy not detecting a newer file so it won’t overwrite, or what else would keep it from copying over on the latest builds/deploys?

Thanks,
-Ken

Hi, @kyeck. The deploys for this site are locked. The deploy with id 5ff3a003313cc500079b7f76 does have that redirect but that deploy is not published at this time. The production version of the site is still using a December 8th deploy (5fd01d0f0f7bd6008ba039cb).

If you publish that deploy newest deploy (or enable auto-publishing a trigger a new deploy), the redirect in question will start working. If there are any questions, please let us know.

Hi Luke,

Unlocking and publishing latest did the trick.

Thank you and the team for the assistance!

-Ken

1 Like