Home
Support Forums

Redirect to primary domain fail

Hello,

I just add my domain aboutgreen.eu to my netlify repository, but previously all site was under aboutgreen.lu with all languages paths. When i type aboutgreen on google it propose aboutgreen.lu. I also have aboutgreen.be and aboutgreen.fr, when a user go to aboutgreen.be it should redirect to aboutgreen.eu/fr-be and aboutgreen.fr should redirect to aboutgreen.eu/fr-lu (temporarily).

I want to do the same for all domain so, i made a visible redirect in ovh from aboutgreen.lu to aboutgreen.eu because all languages where under .lu first, and aboutgreen.be to aboutgreen.eu/fr-be but it doesn’t work… now on aboutgreen.lu it says "Fastly error: unknown domain: www.aboutgreen.lu. Please check that this domain has been added to a service.

Details: cache-ams21078-AMS"

I’m very confused how to do that, i don’t know if i have to link all my others domains in my repository as domain alias or not… i also tried to make redirect in gatsby with “createRedirect” but it doesn’t seems to work too…

Thanks you very much

Hi, @JohannBoumans. Our support team can answer questions about Netlify and our services but we cannot provide technical support for other services. I mention this because the domain aboutgreen.lu isn’t hosted at Netlify currently:

Name server records (type = NS):
aboutgreen.lu.		3599	IN	NS	dns200.anycast.me.
aboutgreen.lu.		3599	IN	NS	ns200.anycast.me.

Records for the apex domain (type = A):
<missing>

Records for www subdomain:
www.aboutgreen.lu.	            3599	IN	CNAME	aboutgreenmain.gatsbyjs.io.
aboutgreenmain.gatsbyjs.io.       29	IN	CNAME	us-eu.gatsbyjs.map.fastly.net.
us-eu.gatsbyjs.map.fastly.net.    29    IN   	A	151.101.54.78

I can share information about how to do this at Netlify though. The steps would be:

  1. Create the required DNS records (as found in the external DNS instructions) for aboutgreen.lu like you have already done for aboutgreen.eu.
  2. Add the custom domain to the site as a domain alias (which I see has already be done).
  3. Add redirect rules to the site and trigger a new deploy with those changes to make those redirects active.

Personally, I prefer the syntax of the _redirects file. In _redirects format the required domain-level redirects might look like this:

http://aboutgreen.lu/*           https://aboutgreen.eu/fr-lu 301!
https://aboutgreen.lu/*          https://aboutgreen.eu/fr-lu 301!
http://www.aboutgreen.lu/*       https://aboutgreen.eu/fr-lu 301!
https://www.aboutgreen.lu/*      https://aboutgreen.eu/fr-lu 301!

These redirects would send any HTTP requests for any URLs at aboutgreen.lu or www.aboutgreen.lu to the /fr-lu path at the aboutgreen.eu domain.

I also have one final comment. I see you have made an A record for the apex domain and made the apex domain the primary domain for the site. When using the A record for the apex, we recommend not making the apex the primary domain. There is more about why in this blog post, quoting:

There’s one small but unavoidable downside here: manually setting an A record on your apex domain that points to our load balancer doesn’t let us insert any advanced traffic direction. We have no way of routing users who go to example.com (without the www. ) to the closest or most performant CDN node. Luckily, any suboptimal performance will only affect site visitors the first time they go to the bare domain; after that, their browser cache will have the redirect to www.example.com , where they’ll benefit from our globally distributed infrastructure.

If there are other questions about this, please let us know.

1 Like

Hello,
i didn’t knew aboutgreen.lu was pointing again to gatsby cloud… it’s a company that takes care of the dns so it’s hard for me to make my own test to learn how to do!
So i guess i have to add aboutgreen.lu www.aboutgreen.lu .be .fr as domain aliases, then make a redirect file, like this if i want the .lu/fr-lu to .eu/fr-lu and .lu/fr-be tp .eu/fr-be to keep SEO =>
http://aboutgreen.lu/fr-lu https://aboutgreen.eu/fr-lu 301!
https://aboutgreen.lu/fr-lu https://aboutgreen.eu/fr-lu 301!
http://www.aboutgreen.lu/fr-lu https://aboutgreen.eu/fr-lu 301!
https://www.aboutgreen.lu/fr-lu https://aboutgreen.eu/fr-lu 301!

http://aboutgreen.lu/fr-be https://aboutgreen.eu/fr-be 301!
https://aboutgreen.lu/fr-be https://aboutgreen.eu/fr-be 301!
http://www.aboutgreen.lu/fr-be https://aboutgreen.eu/fr-be 301!
https://www.aboutgreen.lu/fr-be https://aboutgreen.eu/fr-be 301!

But with these redirect i guess i also need to make a visible redirect in the domain hosting too?

i tell the guy to do that for aboutgreen.be to redirect to aboutgreen.eu/fr-be and
aboutgreen.lu to aboutgreen.eu because al languages were before under .lu and now it’s everything under .eu so i tell him to redirect to .eu instead of .eu/fr-lu.

But i’m not very sure of what i’m doing because something with these redirects url become aboutgreen.eu/fr-lu/fr-be. I don’t know if i just have to redirect .be to .eu and .lu to .eu.

I changed my www.aboutgreen.eu to my primary domain as i saw in the blog post you shared.

Thank you so much for your help!

Hey there!

I can see a lot of different redirect rules, based on the different domains. I don’t see any redirects based on particular paths.

I don’t know if i just have to redirect .be to .eu and .lu to .eu.

If you simply want to redirect different domain TLDs (.be, .eu, .lu) then you can use rules like this:

http://aboutgreen.lu/* https://www.aboutgreen.eu/:splat 301!
https://aboutgreen.lu/* https://www.aboutgreen.eu/:splat 301!
http://www.aboutgreen.lu/* https://www.aboutgreen.eu/:splat 301!
https://www.aboutgreen.lu/* https://www.aboutgreen.eu/:splat 301!
[etc]

And then the same for the other TLDs!

If you require something different, please do let me know and we will be happy to help.