Robots.txt

How do you stop Google indexing you robots.txt ?

I don’t want users poking around in the Folders I have banned Google from :

take webmasterworld ( actually I’m with Brett on this one )

Brett cloaks his robots.txt :


http://www.webmasterworld.com/robots.txt

But Google has to get the real one :


Google Cached Copy
of WMW robots.txt

How do I stop Google showing my Robots.txt to the world

DaveN

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • Live
  • StumbleUpon
  • Facebook
  • Google
  • Reddit
  • Technorati

21 Comments | Leave a comment »

  1. 1. TheShaneDJShow | August 17th 2007 @ 1:23 pm

    can you not password protect it in th .htaccess file at all? or will that also block the spiders

  2. 2. quadszilla | August 17th 2007 @ 1:52 pm

    Dave - why don’t you just cloak? or are you more asking in the general sense for less sophisticated webmaster?

  3. 3. JohnMu | August 17th 2007 @ 1:59 pm

    X-Robots HTTP tag ?

  4. 4. DaveN | August 17th 2007 @ 2:26 pm

    @quadszilla yer more general webmasters and also if you mention Cloaking to a Corp Webmaster they tend to poo their pants a little,

    DaveN

  5. 5. Shimon Sandler | August 17th 2007 @ 2:48 pm

    Perhaps disallow robots.txt file in the robots.txt file so the robots.txt file isn’t indexed;-)

  6. 6. JohnMu | August 17th 2007 @ 3:21 pm

    It’s not cloaking, it’s personalization!

  7. 7. Rob Haswell | August 17th 2007 @ 3:38 pm

    The only way to stop Google indexing stuff without exposing yourself is to properly protect the areas you’re hiding.

    That means in library folders use with “deny from all” in a .htaccess, or use some sort of login system (possibly HTTP Basic), or restrict by IP.

  8. 8. Richard Hearne | August 17th 2007 @ 4:34 pm

    If memory serves me correct then oracle.com do simple cloaking based on user agent. Pretty good example to give to corporate client I reckon :)

    Couldn’t you just use x-robots tag in the header to stop Google indexing the file?

  9. 9. g1smd | August 18th 2007 @ 1:25 pm

    Double blind also works.

    Use

    Disallow: /foo

    in the robots.txt file.

    Inside that folder set DirectoryIndex to OFF so that none of the filenames can be listed.

    Inside that folder create a folder: /foo/bar/

    Again set DirectoryIndex to off for that sub-folder.

    Put the stuff you don’t want to be found inside that sub-folder.

  10. 10. g1smd | August 18th 2007 @ 1:28 pm

    In robots.txt be moe clever as to what you disallow, in how you define it.

    You have a folder called /scripts/.

    Normally you would put:

    Disallow: /scripts

    in the robots.txt file.

    Instead, call the folder /scripting462782/ or some such number.

    Make sure that is the only folder name that begins with /scr

    In the robots.txt file use

    Disallow: /scr

    That will disallow any URL that begins /scr without exposing the real path name.

  11. 11. Rob Haswell | August 20th 2007 @ 12:12 pm
  12. 12. Click Input | August 20th 2007 @ 7:45 pm

    So anyone find a solution to this?

  13. 13. g1smd | August 20th 2007 @ 8:54 pm

    Is that agreeing with me, or pointing to a problem?

  14. 14. DWR | August 24th 2007 @ 9:43 am

    Just put:

    Options -Indexes

    into your htaccess file and it will block folks from getting into any directory that doesn’t have an index file in it.

  15. 15. DWR | August 24th 2007 @ 9:44 am

    That doesn’t keep your robots file from being Googled, but it does solve the problem of folks “poking around in your directories”, so the initial desire is fullfilled.

  16. 16. Igor The Troll | August 29th 2007 @ 10:19 am

    Use the if’s in the htaccess if condition user agent blah blah serve the file blah blah…

    Maybe you guys can look up the apache syntax?

  17. 17. Igor The Troll | August 29th 2007 @ 10:22 am

    But a good proxy will by pass it, so if you want to see Bert’s robot.txt just write a proxy to pretend to be Google…

    Guess JohnMu has one to lend you..

  18. 18. Igor The Troll | August 29th 2007 @ 10:58 am

    Dave, forget about asking JohnMu for a proxy script, I have just learned he is one of them now…

    So all his hacking has finally payed off and he has been rewarded as the new Googler…

    Well lose some win some.

    Maybe he will make sure none of our sites are deindexed inadvertently by Google. :)

    But if you are interested in reading a cloked robots.txt with a proxy, look into curl_init in PHP

  19. 19. SeLvesTr | October 10th 2007 @ 10:13 am

    So what is the verdict? Did anyone test and find a perfect solution to this?

  20. 20. JohnMu | November 5th 2007 @ 11:23 am

    You can disallow your robots.txt in your robots.txt:

    user-agent: *
    disallow: /robots.txt

    That will keep it from getting crawled and will prevent a “cached” link from appearing (if it is shown in the index anyway). Google will still be able to access it. If you want to prevent users from seeing it as well, you can use the bot identification setups available for the major search engine bots and only serve them the real file.

  21. 21. led display | May 31st 2008 @ 8:06 am

    May Just use a 301 redirect.

Leave a Reply

required

required, hidden