Closed Thread Icon

Topic awaiting preservation: Restricting access to a directory... Pages that link to <a href="https://ozoneasylum.com/backlink?for=12818" title="Pages that link to Topic awaiting preservation: Restricting access to a directory..." rel="nofollow" >Topic awaiting preservation: Restricting access to a directory...\

 
Author Thread
krets
Paranoid (IV) Mad Scientist

From: KC, KS
Insane since: Nov 2002

posted posted 07-16-2003 14:17

I'm running a php program called galleryon my page and I'd like to deny access to the raw album directories. Because of the nature of Gallery I can't just dump an index.html in there and the tutorials I've found so far on .htaccess have clear as mud.

I want to allow hotlinking because several of my friends have directories from which they post to forums and such. I just want to make sure that for certain directories no one can type the album name in and get access to it's entire contents.

Any clues?

:::11oh1:::

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 07-16-2003 14:27

I'm not sure if this is exactly what you're looking for, but if you just want to disable the directory listings which appear when there is no index.* file you could put this line

code:
Options -Indexes


into your .htaccess file. Hope that helps


kuckus

[This message has been edited by kuckus (edited 07-16-2003).]

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 07-16-2003 14:38

Hmm.... how about if I want to allow indexing of the directory that presently returns a 'Forbidden'?

and- on a separate note- what if I want a cgi to run thru the directory as default without adding an 'index.cgi'?
Basically, trying to format the output of the directory index...

[This message has been edited by Petskull (edited 07-16-2003).]

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 07-16-2003 14:46

To run a cgi automatically without making it index.cgi, find this line in your HTTPD.conf:

DirectoryIndex

and add the name of your CGI filename in there.

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 07-16-2003 15:06

Petskull-

quote:
Hmm.... how about if I want to allow indexing of the directory that presently returns a 'Forbidden'?



In that case you'd probably want to use

code:
Options +Indexes



kuckus

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 07-16-2003 20:28

Is there anyway of customizing the 'index page' of the contents *without* a cgi?

...maybe simply a stylesheet or modding how the html is output (such as removing the little images an stuff..)?

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 07-17-2003 00:15

Yep, that's possible - see this link:

http://httpd.apache.org/docs/mod/mod_autoindex.html#headername

You can have it include a header file at the top the listings and then put your CSS etc. in there.

And somewhere on that same page there's also a directive which lets you set the icons' height/width, so using that one to set it to zero should get rid of the icons (although there might be a more elegant way of doing that...).

« BackwardsOnwards »

Show Forum Drop Down Menu