Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    151
    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:
    151
    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:
    778
    Likes Received:
    4
    Trophy Points:
    318
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. desi6n

    desi6n Member

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice