Hi!
I have a concern about my netlify default subdomain. I’ve already pointed my netlify to my domain but I still can get into my default subdomain.
I guess it can affect SEO because is duplicate content. So, what is the best solution for that? Remove the default subdomain or redirect?
Can someone tell me what is the best option and how to make it?
Thank you!
If I understand your question, there are two things you can do.
Put a link on your webpages that specify the canonical URL for the content, and
Add a link to your _redirects file that is something like this:
# Redirect default Netlify subdomain to primary domain
https://domain.netlify.app/* https://www.domain.com/:splat 301!
1 Like
Hi @gregraven , thank you for your response! One question, how and where should I create the _redirects file? It’s this inside the Gatsby project?
@jotafelix I don’t use Gatsby, but my guess is that you would create it as a static file in such a way that it would wind up at the top level of your website after the build process.
jen
May 14, 2020, 6:55pm
5
Hey @jotafelix ,
You should actually be set already: if you use a custom domain and don’t already have rel="canonical"
links in your HTML, then Netlify adds a special header to tell crawlers what the canonical URL is and to ignore the Netlify subdomain. More on the feature here:
Hi all,
Next Monday, March 30th, we’re going to make a change to improve SEO in sites that have configured a custom domain. I want to tell you a little bit more about it before we roll it out.
Every time you create a new Netlify site, we assign a subdomain for it in our primary domain, netlify.com , for example happy-wozniak-23hdl3.netlify.com . As you might already be aware, on April 14 2020, we’re changing that domain to netlify.app , so that previous example will become happy-wozniak-23hdl3…
Wanna have a look and let us know if you have any questions?
Hi @jen , thank you for the response! Yes I checked on my Netlify subdomain and it’s pointing to my canonical URL.
I have a question, what means inside the canocical link the following?
data-baseprotocol=“https:” data-basehost=“www.felixdigital.es”
data-baseprotocol and data-basehos, it’s normal?
Thanks!
jen
May 17, 2020, 12:46am
7
Hey @jotafelix , I’m not sure where you’re seeing those parameters. Can you please post a screenshot and then I can try to get you some answers?
@jen I attach a screenshot, please check out,
Scott
May 20, 2020, 1:28pm
9
Hey @jotafelix ,
For a Gatsby site, these are perfectly normal . I’m sure other SSGs may do something similar !
Hi @Scott ,
Thank you very much! yes, it seems normal!
Hey @gregraven !
I did this, but my SEO is bad. What do you think?
Hey guys!
I’m using the standard Gatsby template “gatsby-starter-default” with primary domain and I have a bad SEO. The Default subdomain (netlify.app) has a good SEO. How can I redirect SEO Default subdomain to the Primary domain?
What I’ve tried to resolve the conflict:
1st - I installed the Gatsby plugin “gatsby-plugin-canonical-urls ” and configured the primary domain (gatsby-config.js).
{
resolve: `gatsby-plugin-canonical-urls`,
options: {
siteUrl: `https://brunoce…
jen
August 29, 2020, 5:53pm
12
Hey @LimaBruno ,
Did you see this post?
Hey @jotafelix ,
You should actually be set already: if you use a custom domain and don’t already have rel="canonical" links in your HTML, then Netlify adds a special header to tell crawlers what the canonical URL is and to ignore the Netlify subdomain. More on the feature here:
Wanna have a look and let us know if you have any questions?
If you’re seeing something different, could you please share your Netlify URL so we can take a look?
Hi @jen
The redirect seems to work. I had forgotten the exclamation point “301!”. But my SEO is still very bad