Authorizing Folders - protect from public view

desi6n

Member
Apr 15, 2004
21
0
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!!!:)
 
Last edited:

desi6n

Member
Apr 15, 2004
21
0
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?
 

mickalo

Well-Known Member
Apr 16, 2002
782
5
318
N.W. Iowa
Originally posted by desi6n
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?
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
 

GeekPatrolMille

Well-Known Member
Mar 12, 2004
84
0
156
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