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).
I don’t have that plugin for SEO testing, but using SEO Checker | Test your website for free with Seobility shows that your gatsby-plugin-canonical-urls is working - the HTML meta tag is in place and the SEO tool is reading that.
That should do it as far as canonical-urls are concerned with SEO!
That said, I don’t see your redirects actually running. Where do you have your _redirects file in the context of your site folder structure?
Is that repository up to date? There’s a lot happening in your latest build that is not accounted for in that repository. I don’t see a netlify.toml or anything
An example would be that your build is using build-plugins which is a feature that, as far as I know, only works when you are using a netlify.toml file. How are you using build plugins?
Ah, that’s on me - I haven’t used Plugins outside of declaring them in the netlify.toml file, but it appears yes you can install them on a site without having the toml file
As for the issue with your _redirects not working, I think you just need to change the 301 to a 301! (add an exclamation point) - the behavior you’re seeing, where the page is loading on that domain even though you have a redirect defined is called shadowing and worth reading about. Any time we want to push to the primary domain from an alias, we need to force the redirect (with exclamation mark) to ensure that the shadowing effect is ignored
How are you? I put the exclamation point (301!) and is redirecting to the primary domain, but I don’t understand why my SEO is bad. I also use the Google Search Console
hi @LimaBruno, when you say your “SEO is bad” what do you mean exactly? Also - none of us here are really SEO experts, although we can try to give general advice