1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Block Website Folder From Indexing With .htaccess

Discussion in 'Blogging' started by Claudiu, Mar 16, 2010.

  1. Claudiu

    Claudiu Regular Member

    Joined:
    Feb 28, 2009
    Messages:
    287
    Likes Received:
    81
    Location:
    127.0.0.1
    I have a website that has confidential files stored in a folder and I'd like to use htaccess to block google from indexing the confidential folder.

    I don't want to use robots.txt as anyone can then access the robots.txt and see what directories are restricted from being seen on G.

    Password protecting the folder is also not an option as that folder is needed by the website to access the files inside the confidential folder.

    I'd appreciate suggestions on this ..
     
  2. tukim

    tukim Regular Member

    Joined:
    Sep 20, 2009
    Messages:
    254
    Likes Received:
    173
    Location:
    localhost
    You can just do it from your cPanel...if you have it. Scroll down to the indexing option and choose the directory, then block indexing.
     
    • Thanks Thanks x 1
  3. cjw10

    cjw10 Junior Member

    Joined:
    Jan 7, 2010
    Messages:
    116
    Likes Received:
    32
    Occupation:
    Student
    Location:
    Illinois
    You can create a .htaccess for the folder and drop this inside the htaccess:

    Code:
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    
    That should work