How to hide azure vm technical url from search engines?

I have a project in an Azure virtual machine with the technical addresses "myproject.cloudapp.net" and "myproject.com". Search engines indexed the technical address (myproject.cloudapp.net) and my project in the search results with the technical address.

How to hide azure vm address (*. Cloudapp.net) from search engines?

+5
source share
2 answers

I assume you have a web application. You will need to create a redirect rule that checks which domain has been requested, and if it matches *.cloudapp.net , then redirect to mydomain.com permanently.

In web.config something like this answer :

 <rewrite> <rules> <rule name="Redirect to www" stopProcessing="true"> <match url="(.*)" /> <conditions trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^.*.cloudapp.net$" /> </conditions> <action type="Redirect" url="{MapProtocol:{HTTPS}}://www.domain.com/{R:1}" /> </rule> </rules> <rewriteMaps> <rewriteMap name="MapProtocol"> <add key="on" value="https" /> <add key="off" value="http" /> </rewriteMap> </rewriteMaps> </rewrite> 

Disclaimer: I have not tested this redirect in web.config . My applications run Asp.Net MVC, and I redirect, adding a global filter that does a few extra checks.

0
source

You do not hide * .cloudapp.net because you do not own it. You must put the robots.txt file in the root folder and set it to nofollow. This is well documented on the Internet, so I would not repeat it, but this is how to stop the search engines by crawling your site and indexing it.

To remove yourself from them, you will need to request it. There is a well-documented process for every search engine.

0
source

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


All Articles