How to prevent Heroku app from Google indexing?

Despite the searches, I did not find a definitive answer to this question.

I have 2 applications in Heroku:

  • myapp-stagging.herokuapp.com
  • myapp-with-real-domain-name.com

These 2 apps currently have no content (no indexes on Google)

Before clicking on their content, I would like to make sure that my tracking application will not be indexed by Google. What is the right way to do this? I do not understand, because people are talking about the robots.txt file, but where should I write this file?

Thanks.

PS: is this the right StackExchange site to ask about this? Sorry if not.

+8
heroku
source share
2 answers

Take a look at the full instructions here - http://www.robotstxt.org/robotstxt.html

Like it: the robot wants to display the website URL, say, http://www.example.com/welcome.html . Before he does this, he first checks http://www.example.com/robots.txt

I think this gives you an idea where to place robots.txt

+2
source share

I found a similar question in Webmasters StackExchange: https://webmasters.stackexchange.com/a/65378/31283

You can add a rel canonical tag link to every page of your application.

<link rel="canonical" href="http://myapp-with-real-domain-name.com" /> 
+1
source share

All Articles