1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Robots.txt Help to Block a Particular File Name

Discussion in 'robots.txt' started by Kushal Biswas, Feb 3, 2016.

  1. #1
    How do I block a particular file name via robots.txt file no matter where it appears ?

    So, I would like to block a file gallery.htm and I have this particular file in various folders in my website.

    For example,



    It will take a lot of time, if I have to manually identify and block this file.

    I have tried the below code –
    Disallow: */gallery.htm

    However, it doesn’t work.

    Any suggestion regarding this would be great.
    Kushal Biswas, Feb 3, 2016 IP
  2. Anubhav-soin

    Anubhav-soin Member

    Likes Received:
    Best Answers:
    Trophy Points:
    You can find the answer here http://www.robotstxt.org/robotstxt.html.
    You will have the complete understanding of how it works and how to allow and disallow the file or folder.

    Please note here, even if you block the file from robots.txt. It will take some time to disappear from the net as it has already been indexed by google, bing and all other bots. So i would suggest, wait for some time (could be weeks ). Alternative to that is you can block the url from being indexed in the webmaster console.
    Anubhav-soin, Feb 25, 2016 IP