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.

Authorizing Folders - protect from public view

Discussion in 'General Discussion' started by desi6n, May 29, 2004.

  1. desi6n

    desi6n Member

    Joined:
    Apr 15, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I am wondering if anyone knows how to protect a folder's contents (ie images files) from public view while still allowing the page that contains the images to be viewed. If I put the address (for example) - www.mysite.com/images/ - I get a page with the list of my images - I would like the public to see a "You are not authorized to view this page" page instead but I know my permissions must be 755. Does anyone have a solution to this?

    I tried password protection, but that is not what I need . . .

    Thanks!!!:)
     
    #1 desi6n, May 29, 2004
    Last edited: May 29, 2004
  2. desi6n

    desi6n Member

    Joined:
    Apr 15, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    I found the answer! Index manager!

    Is there any way to create a default page that people will view if they try to access the index of a folder?
     
  3. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    create a simple 'index.html' and put into the folder, then when they try to view this folder, they will get the index file instead of the 403 access denied error :cool:

    Mickalo
     
  4. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    This seems to be a common question... One that I was in search of as well up till a short while ago... I worked this into the /etc/httpd/conf/httpd.conf file just after the section
    <Directory /home/*/public_html>
    ...
    ...
    ...
    </Directory>

    #################################################################################################### gmiller 2004/05/13
    # added to restrict Directory Listing by default to all sites server-wide

    <Directory /home/*/public_html>
    Options -Indexes
    </Directory>

    ####################################################################################################


    Causes the directory listings to be disabled completely unless the .htaccess file in the site directory explicitly enables the feature.

    Hope this helps...
    -greg
     
  5. desi6n

    desi6n Member

    Joined:
    Apr 15, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the help!!!:)
     
Loading...

Share This Page