Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent an Heroku app from Google indexing?

Tags:

heroku

Inspite of searches, I didn't find a final answer to this.

I have 2 apps in Heroku:

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

These 2 apps have no content for now (there are not indexed in Google)

Before pushing content to them, I'd like to be sure that my stagging app will be not indexed in Google. What is the right way to do it? I don't understand because people talks about robots.txt but where am I supposed to write this file?

Thanks.

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

like image 936
David D. Avatar asked Oct 01 '14 18:10

David D.


People also ask

How do I stop Google from indexing my domain?

You can prevent a page or other resource from appearing in Google Search by including a noindex meta tag or header in the HTTP response. When Googlebot next crawls that page and sees the tag or header, Google will drop that page entirely from Google Search results, regardless of whether other sites link to it.


2 Answers

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

You could add a link rel canonical tag on every page of your app.

<link rel="canonical" href="http://myapp-with-real-domain-name.com" />
like image 83
Mark Biesheuvel Avatar answered Sep 20 '22 12:09

Mark Biesheuvel


Take a look for complete instruction here - http://www.robotstxt.org/robotstxt.html

It works likes this: a robot wants to vists a Web site URL, say http://www.example.com/welcome.html. Before it does so, it firsts checks for http://www.example.com/robots.txt

I guess it give you idea where to place robots.txt

like image 40
Mysterion Avatar answered Sep 23 '22 12:09

Mysterion