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?
Azure domain being indexed by google
2.3k Views Asked by AudioBubble At
2
There are 2 best solutions below
0

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.
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
ref: http://4sln.com/Articles/how-to-create-a-url-rewrite-rule-for-azure-websites-to-use-single-custom-domain