treehouse : what would you like to learn today?
Web Design Web Development iOS Development

hiding folders

  • Hey guys and gals, I was just wondering if anyone new of a way of hiding a folder in my web directory, so that google wouldn't index it, but I would still be able to create direct links to html files to send to clients.

    The problem is that I'm a web/graphic designer and I have been putting test sites in my own web directory, but unfortunately one of my clients noticed their site in a google search today and it was the version behind my site.

    I'm not sure what best practice would be, so any advice would be greatly appreciated.
  • have a robots.txt file

    put it in your root level and have something like this in it

    User-agent: *
    Disallow: /cgi-bin/
    Disallow: /images/
    Disallow: /htdocs/
    Disallow: /whatever other directory you wish/

    or an .htaccess file
  • what ikthius said, and add a 'noindex' to the header of that directory page:

    <html>
    <head>
    <meta name=\"robots\" content=\"noindex\" />
    <title>Don't index this page</title>
    </head>

    http://en.wikipedia.org/wiki/Noindex
  • thank you both. I appreciate your help.
  • what does the * mean in User-agent: * . Just interested.
  • "dodgson" said:
    what does the * mean in User-agent: * . Just interested.

    It usually means "anything", so I assume it does in this case as well. "User-agent: any" would be my guess.