Azure domain being indexed by google

2.3k Views Asked by At

I have a website that has a domain 'example.azurewebsites.net'. I also have a custom domain configured for it 'www.example.com'. Google is indexing my 'example.azurewebsites.net' website and I want it to stop and only index it has 'www.example.com'. How do I go about doing this?

2

There are 2 best solutions below

1
On BEST ANSWER

I believe you like to use www.yoursite.com rather then yoursite.azurewebsites.net. If so, you can place this rule to your web.config

<system.webServer>

 <rules>

   <rule name="SEOAzureRewrite" stopProcessing="true">

     <match url=".*" />

     <conditions>

       <add input="{HTTP_HOST}" pattern="^oldwebsite.azurewebsites.net$" />

     </conditions>

     <action type="Redirect" url="http://www.new-web-site.com/{R:0}" redirectType="Permanent" />

   </rule>

 </rules>

ref: http://4sln.com/Articles/how-to-create-a-url-rewrite-rule-for-azure-websites-to-use-single-custom-domain

0
On

I guess change of address tool it's what you are after. Have a look at this https://support.google.com/webmasters/answer/83106?hl=en

You can also return a dynamic robots.txt based on domain:

example.azurewebsites.net/robots.txt:

User-agent: *
Disallow: /

www.example.com/robots.txt:

User-agent: *
Allow: /

Example here

But change of address tool is probably better.