29
Domain redirects
planned
Aaron Adams
When I configure multiple domains for one site, I should be able to select a primary domain. The other domains should redirect to the primary domain.
This is not possible today because
createRedirect
only works with paths, not domains.I believe redirecting secondary domains to the primary domain is a more common use case than serving the same site from multiple domains.
Activity Feed
Sort by
John Duda
This would be a very welcome improvement, don’t want to have to host a separate server just to handle these kind of redirects!
Dwayne Holmberg
Adding my support for this feature. We have a client with multiple top level country domains that need to redirect to .com.
Top reasons:
1) SEO: search engines hate duplicate content
2) Font licensing is frequently per-domain.
We've temporarily set up a Digital Ocean droplet to handle the redirects, but this is obviously not ideal.
Stijn van Lieshout
Strange that this is not supported yet. A very common use case I'd say.
I just upgraded our membership for multi-domain support, but now in the site settings in cannot redirect our old .eu domain to our new .co domain.
When will this be supported?

L
Lettie
This could be good for our scenario with a few extra regex options to check what domain has been used. We have several small project sites set up on webflow. These have now been integrated into the main domain. The projects are set up on subdomains of domain2 and are currently being re-directed to the relevant pages on the main domain by webflow. We are now in a position that we want to turn off webflow as we no longer need these small project sites. However this poses the question how can we re-direct the sub domains on domain2 to point to the relevant pages on our main domain. For example:
subdomain.domain2.com/resources
would need to point to
So the ability to check what domain is redirecting and then point it appropriately would be great.
Munyaradzi Hozheri
Hey! This is to also bump this feature. We are in the process of migrating our entire site to gatsby & this feature would be great in our quest for performance & better SEO standing. We have an existing set of redirects that redirect to external sites - as it is we can not redirect to external sites. We have in excess of 3k redirects, most of which are legacy and have to point to an external site or service.
L
Lukas Hofer
I'd like to bump this feature request. We have multiple similar domain names (some with a dash, some without) and we'd like to redirect all of them to a main domain.
J
Jerome Dahdah
Hey! We have multiple country-specific domains that redirect to localized subdirectories of the main website. So:
https://www.example.com/ → https://www.example.com/en/
https://www.example.com/* → https://www.example.com/en/*
https://www.example.de/ → https://www.example.com/de/
https://www.example.de/* → https://www.example.com/de/*
https://www.example.fr/ → https://www.example.com/fr/
https://www.example.fr/* → https://www.example.com/fr/*
etc. We also have a few vanity URLs that need to be redirected similarly.
This is super easy to do with Netlify (docs: https://docs.netlify.com/routing/redirects/redirect-options/#domain-level-redirects). Right now we are using the Netlify-specific
_redirects
file for those redirects, while we have moved everything else over to createRedirect
in gatsby-node.js for a more idiomatic Gatsby approach. This is the only technical restraint preventing us from making the switch from Netlify to Gatsby Cloud.J
Joel Smith
planned
Slight adjustment. We've added the ability to redirect the provided url (sitename.gatsbyjs.io) but not other custom domains. Very possible and we'll add it to the roadmap!
S
Shruti Chaturvedula
complete
We now support domain redirects
d
david lin
+1 This is desperately needed, for a project migrating from old server to Gatsby host. We rebuild the site using Gatsby, and the URL structure has changed. We need to redirect from a few sub-domains (alias) to the "apex" domain. For example, from "fr.example.com", "en.example.com", etc. to "example.com". As others mentioned, at the moment, only "www" redirect is added automatically when adding customer domain.
Load More
→