Azure Domain Indexed by Google

I have a site with the domain example.azurewebsites.net. I also have a custom domain configured for it "www.example.com". Google indexes my site example.azurewebsites.net and I want it to stop and only index it at “www.example.com”. How can I do it?

+6
source share
2 answers

I believe that you like to use www.yoursite.com , not yoursite.azurewebsites.net . If so, you can put this rule in 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

+5
source

I think changing the address tool is what you need. Take a look at this https://support.google.com/webmasters/answer/83106?hl=en

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

example.azurewebsites.net/robots.txt:

 User-agent: * Disallow: / 

www.example.com/robots.txt:

 User-agent: * Allow: / 

Example here

But changing the address tool is probably better.

0
source

Source: https://habr.com/ru/post/978010/


All Articles