Licking down directories

kaitia

New Member
Messages
7
Reaction score
0
Points
0
Hey there folks,

I am trying to figure out how to prevent users from accessing a directory but at the same time viewing photos from the directory (via a webpage). I tried using the cPanel functions but the lockdown feature does not work (at least for me).

I tried creating a directory outside of the public directory and then accessing the photos view ../myimages/, but that did not work.

Does anyone have any other suggestions?

Thanks.
Also, I am using the free plan...
 

jeeter

New Member
Messages
9
Reaction score
0
Points
0
Perhaps put an index.php file into the directory that redirects the user if they go to it?

Like so:

index.php
PHP:
<?php header("location:DESTINATION"); ?>

Where DESTINATION is where you want the user to be redirected to.
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
I'm not sure what you mean?

Do you mean that you want to prevent users from accessing a page in a directory - or the whole directory itself.

If you prevent access to the whole directory, then by default, you are also denying access to any images in that same folder.

You can set up sub-directories and use the .htaccess file system to control access.

That way, you can prevent access to some folders and allow access to others.

Does this help?

By the way, this would do better under programming help - maybe admin can do this for you.
 

tittat

Active Member
Messages
2,478
Reaction score
1
Points
38
Not well sure about what you are asking about.But are looking for how to disable "index of" ????

If so add an .htaccess file to your web root with the following in it:

options -indexes

*****Thread Moved to Programing Help*****
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
changing the permissions for the directory is also an option, but it doesn't stop the user from viewing the image if they know the exact name and folder of it.

CHMOD 711 will give any user typing in the folder name a 401 - Forbidden error, but images can still be accessed from your pages and scripts.
 

fguy64

New Member
Messages
218
Reaction score
0
Points
0
I just learned myself :p

Being a Windows user since 3.1, this all still seems like black magic to me :eek4:
Edit:
This article is really helpful on the subject of linux permissions: http://www.zzee.com/solutions/linux-permissions.shtml

Ah yes. Good old Windows 3.1. I cut my teeth doing tech support for 16-bit applications. In those days techies actually had control over what went on "under the hood". It's not like that any more :)

Garrett, in addition to the article you suggested, which is really good, there is nothing to stop people from doing their own testing by setting up a practise directory with some html and jpg files, and experiment with directory and file rights to see what happens.
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
Ah yes. Good old Windows 3.1. I cut my teeth doing tech support for 16-bit applications. In those days techies actually had control over what went on "under the hood". It's not like that any more :)

Garrett, in addition to the article you suggested, which is really good, there is nothing to stop people from doing their own testing by setting up a practise directory with some html and jpg files, and experiment with directory and file rights to see what happens.

Not a bad idea for old Windows nerds like myself :p

I still find myself digging through that article to find what I need.
 

OdieusG

New Member
Messages
50
Reaction score
0
Points
0
What I think the original topic is with this:
Code:
http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#indexignore
 
Top