Writing robots.txt for extensionless urls

Discussion in 'robots.txt' started by solomon1, Jan 26, 2010.

  1. #1
    I have used a .htaccess file to rewrite my urls without .html extension.
    Does this mean that when I define which file I wish to exclude from the bots in my robots.txt I also write them without url?
    The reason I ask is I notice some robots.txt files I've looked at refer to directories like this:
    /folder

    and some like this

    /folder/

    in my case /folder would refer to an actual file written without the extension and not a folder...

    Hop this is clear - my first post by the way - so Hi.
     
    solomon1, Jan 26, 2010 IP
  2. BestNetCraft

    BestNetCraft Well-Known Member

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #2
    It is simpler for you to place your files which need to be excluded in one directory and mark the directory in your robots.txt like so: (assuming that the directory name is private)

    User-agent:*
    Disallow: /private
     
    BestNetCraft, Jan 27, 2010 IP
  3. solomon1

    solomon1 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    But if I have one file, say example.html, do I refer to this in my robots.txt as example or as example.html (In the browser address bar the user sees the file name without the extension due to the .htaccess rewrite.)
     
    solomon1, Jan 27, 2010 IP