Folder Access

They have: 218 posts

Joined: Apr 2001

How can you stop public access to the contents of a folder, by someone who types in a url such as:

http://www.url.com/folder/

...even if the folder has a 777 attribute? .htaccess files don't seem to be working on this server...is there another way to limit access, via PHP? Also, how do you delete .htaccess files?

Thanks,

TM

edit: this command, in an .htaccess file, seems to work: Options -Indexes FollowSymLinks

mjs416's picture

They have: 127 posts

Joined: Dec 2003

I dont think you want it chmod'd to 777 do you? Thats rwx-rwx-rwx which basically allows for anyone to do anything they want. Some servers wont even allow for you to chmod a file to 777.

I would think .htaccess would work; not very familiar with .htaccess syntax though. Sorry =(

They have: 218 posts

Joined: Apr 2001

It's a client .jpg upload folder...unless there is another way, it needs to be chmod'ed 777.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

The simplest approach is to put an index page that redirects them -- that way they have to know the filename to gain access. If you change the filename when they upload it (ideal), you're golden. So to speak. Unless you then link to those images in the upload folder!

Ideally the upload folder shouldn't ever been used as a browsable directory.

They have: 218 posts

Joined: Apr 2001

The command listed in my first post stops all folders below the root from being browsable. Sessions and passwords for registered users control access to the application.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Ah, didn't see your edit, sorry. Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.