Help with my Robots.txt Pls

Discussion in 'robots.txt' started by adbox, Nov 16, 2009.

  1. #1
    Hey,

    I want to disallow everything in a directory except my /images/ directory.

    I am new with robots.txt syntax.

    adbox
     
    adbox, Nov 16, 2009 IP
  2. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Hi Adbox, You want to block all the pages in a directory except few pages, correct? if this is what you want to do, then here is the simple solution to do it. You can simply do it using following robots.txt:

    user-agent: *
    allow: /directory/page.html
    disallow: /directory/

    if you have any further query, feel free to let me know.
     
    manish.chauhan, Nov 17, 2009 IP
  3. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #3
    hey thanks, yeah I have one last one.

    Can I place a robots.txt into a /subdirectory/ ?
     
    adbox, Nov 18, 2009 IP
  4. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #4
    No, you shouldn't put robots.txt into a sub directory, it should always placed in web root. In case of subdomains, you can put the robots.txt in their root folder.
     
    manish.chauhan, Nov 18, 2009 IP