The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

blocking directory with .htaccess

Discussion in 'General Discussion' started by ph33r420, Jan 19, 2005.

  1. ph33r420

    ph33r420 Active Member

    Joined:
    Jan 8, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    I know how to block access to a directory by making a passwd file and a .htaccess, and putting hte .htaccess in the directory you want to block people from seeing. How would i go about blocking the /image directory of every domain im hosting? doing it the way above would be a lot of work creating passwd files for each users, and impossible cus i don't know the passwords.
     
  2. ph33r420

    ph33r420 Active Member

    Joined:
    Jan 8, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Also, i just tried copying the .htaccess in _private to the /image directory. how can i set it so i can still load images from?


    OK this works!

    # -FrontPage-

    Options None

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthType Basic
    AuthName www.domain.com
    AuthUserFile /home/user/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/user/public_html/_vti_pvt/service.grp


    allmost fix it :D
    how would i block people from viewing a /images directory on the systems webpage since there is no /_private and i can't copy the .htaccess file from it.
     
    #2 ph33r420, Jan 19, 2005
    Last edited: Jan 19, 2005
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,469
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Why can't you add a simple blank index.html?
     
  4. ph33r420

    ph33r420 Active Member

    Joined:
    Jan 8, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    bwhahahahah *im slow* :D
     
  5. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    You don't have to put an index page in every directory to preventing listing of its own content. Do the following:

    1- SSH to your server and find access.conf file
    2- Use your favorite editor such as vi or pico
    3- Replace the entire syntax with the following:

    <Directory />
    Options -Indexes
    AllowOverride All
    order allow,deny
    allow from all
    </Directory>

    4- Save and exit. Now, go to any of your Web site and see if you can view the content of a directory. This is server-wide and safe.

    Hope this helps!
     
Loading...

Share This Page