Domain-level redirect not working

Hello,

I’m trying to setup some domain-level redirects for my site, but it doesn’t seem to work as expected

I’ve used the docs availble here and followed this guide when trying to do the initial troubleshoot, but I’m still stuck, so any help would be appreciated!

My netlify site name is quirky-carson-d332f7.netlify.app

I have the following custom domains configured on the Domain management:

  • xn--90abbedctovpib9azlrc.news (primary)
  • www.xn--90abbedctovpib9azlrc.news (redirects automatically to primary)
  • xn--90abbedctovpib9azlrc.xn--p1ai (domain alias)
  • www.xn--90abbedctovpib9azlrc.xn--p1ai (domain alias)

I understand the domains might seem a bit weird, but its because this is punnycode to represent cyrillic characters in ASCII. These are used in all our DNS records, as well as on Netlify, and all domains are currently working using the deployed Netlify app without any issues.

The problem now is that we want to start doing redirects from all the domain aliases to our primary domain. Following the docs and guide above, I chose to go for these redirects in our netlify.toml file:

[build]
  functions = "./functions"

[[redirects]]
  from = "https://xn--90abbedctovpib9azlrc.xn--p1ai/*"
  to = "https://xn--90abbedctovpib9azlrc.news/:splat"
  status = 301
  force = true

[[redirects]]
  from = "https://www.xn--90abbedctovpib9azlrc.xn--p1ai/*"
  to = "https://xn--90abbedctovpib9azlrc.news/:splat"
  status = 301
  force = true

As I understand, the force = true should force the shadowing, thus both domains should be redirect to the primary domain, which is the exact same behaviour I get when accessing www.xn--90abbedctovpib9azlrc.news, and thats the behaviour I want for all domain aliases as well.

Following the troubleshoot guide linked above, I could check that all 3 redirect rules are being processed (I imagine the 2 configured here, plus the one from www primary domain)

I also found doing some search on another Community posts mentions of people saying you cant use Pretty URLs, but this site has Asset optimization disabled altogether

Am I missing something? Any help or pointers are appreciated!

Hi @lucass :wave:t6: , Welcome to the forums and thanks for reaching out. You setup your redirects correctly, so I am not sure why it isn’t working. Are you still experiencing this issue?

Hi @SamO ! Thanks!

Yeah, unfortunately I’m still experiencing this issue. I haven’t had time to circle back to it yet (also because I was hoping someone could give me a light here :smile:), but my next step will be trying to use the _redirects file instead and see if I have any luck.

If none of that work, I’ll eventually need to do it externally to Netlify, but ideally we would want to do it on Netlify itself, as its way cleaner!

Hi @lucass,

You seem to have /* redirect listed on the top. Mind pushing that to the bottom of the list to see if it works?

Hello!

Sorry, but aren’t both my redirects on /*? You want me to switch the one on the apex domain to the bottom? I’ll test this shortly!

Thats the current state of our config:

[build]
  functions = "./functions"

[[redirects]]
  from = "https://www.xn--90abbedctovpib9azlrc.xn--p1ai/*"
  to = "https://xn--90abbedctovpib9azlrc.news/:splat"
  status = 301
  force = true

[[redirects]]
  from = "https://xn--90abbedctovpib9azlrc.xn--p1ai/*"
  to = "https://xn--90abbedctovpib9azlrc.news/:splat"
  status = 301
  force = true

Unfortunately still not working (neither the apex domain, nor www)

Hi @lucass ,

Looks like the /* /index.html 200 redirect that Hrishikesh mentioned is in a _redirects file, separate from netlify.toml.

Could you try moving the /* /index.html 200 redirect into the netlify.toml file and making it the last redirect rule to see if that works?

Hi Audrey!

We currently don’t have any _redirect file at all in our project at all.

As I mentioned in the opening post, I do see 3 redirect rules being processed in my deploy summary:

But I was assuming the 3 rules were the 2 I’m configuring on the netlify.toml, plus the default www redirect to the primary domain:

That redirect rule is definitely not coming from us, @lucass. It’s coming from somewhere in your repo, something we can’t see. I’m afraid you’d have to track that redirect rule down yourself.

Sorry for the long delay! In the end I did found out we were using a _redirects file in our repository, it just wasn’t exactly on the folder I was expecting!

I apologize for my confusion, everything is working fine now!

Thanks for your help!

1 Like

Hi @lucass :wave:t6:,

Welcome back to the forums and thanks so much for sharing with the community your solution.