Netlify.app and netlify.com subdomains are showing in Google search results

Hey there,

I’ve just noticed that the netlify.app and netlify.com subdomains are appearing google search results, even though I have a _redirects file that 301 redirects to the primary domain. Is there any reason for this? The redirects work, but the results are still showing in Google. One site has had the redirects for 9 months - so crawl time shouldn’t be an issue here right?

EDIT: Also, with the new subdomain url changes, do I need to redirect both .netlify.com and netlify.app or only netlify.app to my primary domain?

Thanks,
Jake

hey jake, can you tell me which domain / site(s) this is regarding? We might be able to pull a lever to help you. thanks!

Hey Perry,

Thanks for taking a look at this. The subdomain appearing in Google search results is webbrew-hmc.netlify.app and webbrew-hmc.netlify.com

Cheers,
Jake

thanks, jake. we’ll look into it and get in touch if we have more information for you :muscle:

Hey @webbrewjake we’ve had a look at this internally, and this subdomain atop our netlify.com domain cannot be manually “Requested for Removal” within the tooling we have at our disposal.

This content/subdomain technically no longer lives on our .com domain, hence we’re unable to request removal from search engines of this non-existent property. In due time, googlebot (and other search engine crawlers) will continue to follow the 301 redirect to your subdomain atop our netlify.app domain and then remove the .com subdomain reference altogether, on its own.

Worth a shot from your end:

  1. Signup for Google Search Console
  2. Add domain properties you’d like to manage
  3. Go through DNS TXT record or other verification
  4. Submit sitemaps and otherwise have control to manage your domains accordingly, going forward

I’m noticing some other, outdated .netlify.com references in-the-wild (https://www.facebook.com/hamiltonmassagecompany/posts/and-with-that-my-website-is-live-im-really-excited-to-have-this-up-and-running-o/479873989492107/), so it’d be worth your time to search around (https://www.google.com/search?rlz=1C5CHFA_enUS875US875&ei=oLm1XqWiNdHT-wSzkYGoDw&q=Hamilton+Massage+Company+Sports+%22netlify.com%22&oq=Hamilton+Massage+Company+Sports+%22netlify.com%22&gs_lcp=CgZwc3ktYWIQAzoFCCEQqwJQmSVYuydgqSloAHAAeACAAU-IAd4CkgEBNZgBAKABAaoBB2d3cy13aXo&sclient=psy-ab&ved=0ahUKEwil8tu9hqXpAhXR6Z4KHbNIAPUQ4dUDCAw&uact=5) and update those, as well.


This Facebook example, in particular, and discrepancy in post content versus attached social card domains referenced is likely due to caching (use FB’s open graph debugger tool to re-fetch open graph content) and/or combination of social meta tags (<meta property="og:url" content="">) needing optimized.



Obviously there’s a redirect chain from .com > .app > your custom domain, but it is resolving correctly at your custom domain eventually. Understand the concerns here and hopefully this helps with some guidance and next steps you can take from your end. Best of luck!

Hey Scott,

Appreciate your explanation for this.

Regarding the Google Search Console stuff - I have the actual domain in there already, and have submitted sitemaps succesfully in the past. It’s my understanding I won’t be able to add webbrew-hmc.netlify.com as a domain property because I can’t verify that domain because I don’t own it, so therefore I can’t request removals that way? If the subdomain no longer lives on your .com domain, then who owns it?

Thanks!
Jake

Hi, @webbrewjake, the subdomain does still exist under our .com domain. Both netlify.com and netlify.app are still registered by our company. No content is served from the domain and it only returns 301s at this time.

You can also avoid having the subdomain indexed even a first time. There are instructions about how to do this here:

https://support.google.com/webmasters/answer/93710

If these headers/tags are used you can prevent Google from indexing until you have the site published at the domain of your choosing. This will prevent the Netlify subdomains from being indexed in the first place.

Now, that the indexing has occurred, the un-indexing becomes more complicated. If there are other question, please let us know.

1 Like

I have (basically) the same question. I want to prevent the netlify.app URL from appearing in Google. I’m using Netlify DNS.

Can someone confirm these are the steps?

Step 1. Save a plain text file called _redirects in my root directory. (Note: My project is just an index.html file in my root directory. I’m not using a build command or generator).
Step 2. Inside of the _redirects file write:
https://example.netlify.app https://example.com 301

Is that it? Do I need to write the http and www versions of these lines too?

Is the netlify.toml file required too?

Thanks

Hi, @vcamp, this all looks correct. The only change I would make is to force the 301 redirect by using 301! in place of just 301.

Yes, I would recommend two rules, one for both HTTP and HTTPS, so this (which also includes the 301! change):

https://example.netlify.app https://example.com 301!
http://example.netlify.app  https://example.com 301!

(All sites are HTTPS at Netlify so this is why both HTTP and HTTPS redirect to HTTPS above.)

Finally, yes, you can do netlify.toml and/or _redirects. I prefer the _redirects file as the syntax is simpler but that is only my personal preference. You can use either one (or even both at the same time with some rules in netlify.toml and other rules in _redirects).

Again though, I would personally just stick with _redirects and the 301! rules above.

If there are other questions, please reply anytime.

Works beautifully. Thank you!