Subdomain appearing in search results

Hello, my domain “” has been live for a few months but I noticed the other day the old subdomain “” was also appearing in the search results. Is there a way I can remove the subdomain so it doesn’t show up on google? I’m assuming looking at my dns records that it’s related to the Netlify files that are currently in there?

Hi, @SovietBeatle. You can prevent this by making sure the site never uses the subdomain version of the site (eliteearthworks, and always redirects to the custom domain version of the site.

This can be done using the Redirects feature:

There are two formats for redirect rules. They both results in identical rules internally but the formats before processing by the build system are different. So, these are two ways of writing the same rule below.

First, the _redirects format as I prefer it (because it is more succinct and, therefore, clearer to me):*  301!

The same rule in netlify.toml format would be:

  from = "*"
  to = ""
  status = 301
  force = true

Whichever file is used, that file then needs to be moved to the publish directory of the site when the site’s build finished. If the file is in the publish directory, the post processing will process the file and create the redirect rules.

Once the rule exists, then will only redirect to and that will mean that will never be indexed again. After some time, the search engine results will be removed. You can expedite the removal by claiming the subdomain via Google’s Search Console and asking for the domain to be re-indexed immediately (and the re-indexing will result in only 301s removing all results).

Awesome! I like easy fixes. Thanks for the help!