Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Mar 2017
    Location
    Delhi
    Posts
    177

    How to use robots.txt file to block a directory?

    How to use robots.txt file to block a directory?

  2. #2
    Registered User
    Join Date
    Feb 2016
    Location
    Bangalore
    Posts
    696
    Sometimes you have a directory containing decorative images, or temp files. And sometimes you may not want this to be indexed in the search engines. You might also have a directory with some private files, which you don't want to have indexed.

    The below will block access to a directory called "images" as well as its sub directories.
    User-agent: *
    Disallow: /images/

    Multiple directories? No problem!
    User-agent: *
    Disallow: /images/
    Disallow: /temp/
    Disallow: /cgi-bin/

  3. #3
    Registered User friendhrm's Avatar
    Join Date
    Feb 2017
    Posts
    212
    Webcrawlers can be prevented from accessing certain directories of your website by using the disallow option in your robot.txt file.

    Web site owners use the /robots.txt file to give instructions about their site to web robots. It works likes this: A robot wants to vist a website URL (example: http://www.example.com/welcome.html). Before it does, it checks for http://www.example.com/robots.txt, and finds:

    User-agent: *
    Disallow: /
    The "User-agent: *" means this section applies to all robots. The "Disallow: /" tells the robot that it should not visit any pages on the site. If you need to prevent the robots from accessing the cgi-bin directory, use the following lines in your robot.txt file:

    User-agent: *
    Disallow: /cgi-bin/
    Robots directives for Disallow/Allow are case-sensitive. Use the correct capitalization to match your website.

  4. #4
    Senior Member
    Join Date
    Mar 2017
    Location
    Delhi
    Posts
    177
    Quote Originally Posted by fayeseom View Post
    Sometimes you have a directory containing decorative images, or temp files. And sometimes you may not want this to be indexed in the search engines. You might also have a directory with some private files, which you don't want to have indexed.

    The below will block access to a directory called "images" as well as its sub directories.
    User-agent: *
    Disallow: /images/

    Multiple directories? No problem!
    User-agent: *
    Disallow: /images/
    Disallow: /temp/
    Disallow: /cgi-bin/
    Thank You for helping me

  5. #5
    Senior Member
    Join Date
    Mar 2017
    Location
    Delhi
    Posts
    177
    Quote Originally Posted by friendhrm View Post
    Webcrawlers can be prevented from accessing certain directories of your website by using the disallow option in your robot.txt file.

    Web site owners use the /robots.txt file to give instructions about their site to web robots. It works likes this: A robot wants to vist a website URL (example: http://www.example.com/welcome.html). Before it does, it checks for http://www.example.com/robots.txt, and finds:

    User-agent: *
    Disallow: /
    The "User-agent: *" means this section applies to all robots. The "Disallow: /" tells the robot that it should not visit any pages on the site. If you need to prevent the robots from accessing the cgi-bin directory, use the following lines in your robot.txt file:

    User-agent: *
    Disallow: /cgi-bin/
    Robots directives for Disallow/Allow are case-sensitive. Use the correct capitalization to match your website.
    Ya, I got it now, Thanks for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.