Robots.txt question

Discussion in 'Search Engine Optimization' started by Brandon Tanner, Aug 7, 2009.

  1. #1
    Hey everyone,

    If I wanted to allow robots only to the index.html page on one of my sites (and disallow them to all the other pages on that site), then would I put the robots.txt file in the public_html directory and do this...

    User-agent: *
    Allow: /index.html
    Disallow: /

    Or would I put the robots.txt file *above* the public_html directory and do this...

    User-agent: *
    Allow: public_html/index.html
    Disallow: public_html/
     
    Brandon Tanner, Aug 7, 2009 IP
  2. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #2
    The bots don't see the folder structure of your hosting account. They only see folder structure of your domain. So it would be the first option.
     
    qazu, Aug 7, 2009 IP
  3. justkidding

    justkidding Active Member

    Messages:
    937
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Best is the first option. disallow all other pages and allow only the index page. You can do the same from other pages header tag by specifically saying noindex, nofollow and index, follow for the index.html
     
    justkidding, Aug 7, 2009 IP
  4. bert300

    bert300 Peon

    Messages:
    167
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i agree...
     
    bert300, Aug 7, 2009 IP
  5. Brandon Tanner

    Brandon Tanner Peon

    Messages:
    68
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Cool. Thanks for the help guys! :)
     
    Brandon Tanner, Aug 7, 2009 IP