0

I'm running a ASP.NET MVC website hosted on Azure and using Traffic Manager as load balancer, thus the users can not only visit the website by custom domain like foobar.yourcompany.com, but also endpoint provided by Azure Traffic Manager like foobar.trafficmanager.net. So do Search Engine crawlers.

Is there any feasible solution to hide the Traffic Manager endpoint from crawlers and expose the custom domain endpoint?

P.S. I know robots.txt.

Vej
  • 390
  • 1
  • 7
  • 28

1 Answers1

1

If you setup your app to return an HTTP 301 permanent redirect to your custom domain when accessed over the Traffic Manager domain, it should stop it from showing up in search results. As far as I know, you can't fully disable the TM domain. Similarly like you can't fully disable the App Service domains.

So e.g. if your app gets a request for:

http://foobar.trafficmanager.net/foo/bar

Redirect it with an HTTP 301 to:

http://foobar.yourcompany.com/foo/bar
juunas
  • 54,244
  • 13
  • 113
  • 149
  • Thanks! It seems that it can be done with IIS: http://stackoverflow.com/questions/22182087/iis-rewrite-rule-to-redirect-specific-domain-url-to-different-url-on-same-domain – Vej Apr 13 '17 at 08:39
  • But will the "foobar.trafficmanager.net" address still be rendered as web result on search engine result pages? – Vej Apr 13 '17 at 08:40
  • Yeah absolutely! IIS Rewrite can do the job. Do check its options carefully so it redirects correctly :) – juunas Apr 13 '17 at 08:40
  • It should not be shown. Google etc. should consider a 301 redirect as a sign that they should not index that, but index the thing it is pointing to. This is how many websites implement "canonical" URLs in that their site will reply on "www" and bare domains, but they redirect one to the other so search results are not duplicated. – juunas Apr 13 '17 at 08:42
  • Okay. Got it. Thanks for your help! – Vej Apr 13 '17 at 08:44