# Subdomain appearing in search results

**URL:** <https://answers.netlify.com/t/subdomain-appearing-in-search-results/119414>\
**Category:** Support\
**Tags:** netlify-newbie\
**Created:** [May 29, 2024, 6:21pm UTC](https://answers.netlify.com/t/subdomain-appearing-in-search-results/119414 "2024-05-29T18:21:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SovietBeatle](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/sovietbeatle/32/56854_2.png) [@SovietBeatle](https://answers.netlify.com/u/SovietBeatle)\
**Post date:** [May 29, 2024, 6:21pm UTC](https://answers.netlify.com/t/subdomain-appearing-in-search-results/119414/1 "2024-05-29T18:21:50Z")

</div>

Hello, my domain “[elite-earthworks.com](http://elite-earthworks.com)” has been live for a few months but I noticed the other day the old subdomain “eliteearthworks.netlify.app” was also appearing in the search results. Is there a way I can remove the .netlify.app 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?

 ![image](https://global.discourse-cdn.com/netlify/original/3X/4/0/40cd6afc61378f84fc3f45507416eec6e9794f2b.jpeg)

 ![image](https://global.discourse-cdn.com/netlify/original/3X/9/c/9cbf7dd2359f92f18a1d43d1e01e7cd70b9bb9f0.png)

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [May 29, 2024, 8:29pm UTC](https://answers.netlify.com/t/subdomain-appearing-in-search-results/119414/2 "2024-05-29T20:29:32Z")

</div>

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

This can be done using the Redirects feature:

> **[Redirects and rewrites](https://docs.netlify.com/routing/redirects/)**
>
> Manage traffic to your site by defining redirect or rewrite rules in a \_redirects file or a netlify.toml file.

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):

```txt
https://eliteearthworks.netlify.app/* https://elite-earthworks.com/:splat 301!

```

The same rule in `netlify.toml` format would be:

```toml
[[redirects]]
  from = "https://eliteearthworks.netlify.app/*"
  to = "https://elite-earthworks.com/:splat"
  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 `eliteearthworks.netlify.app` will only redirect to `elite-earthworks.com` and that will mean that `eliteearthworks.netlify.app` will never be indexed again. After some time, the search engine results will be removed. You can expedite the removal by claiming the `eliteearthworks.netlify.app` 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).

---

<div class="post-metadata">

**Author:** ![SovietBeatle](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/sovietbeatle/32/56854_2.png) [@SovietBeatle](https://answers.netlify.com/u/SovietBeatle)\
**Post date:** [May 29, 2024, 8:47pm UTC](https://answers.netlify.com/t/subdomain-appearing-in-search-results/119414/3 "2024-05-29T20:47:01Z")

</div>

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