Blocking parent directory but not child direcotries

Alles, was den Apache betrifft, kann hier besprochen werden.

Blocking parent directory but not child direcotries

Postby aphatschi » 08. November 2010 17:38

Hi!

I've got the following directory structure:

Code: Select all
/foo/
/foo/bar
/foo/baz
...
/foo/*


/foo/* means that it is a dynamic structure and any directory could be created.

Now I want /foo/ to be unaccessible and all its sub-directories /foo/* to be accessible.

How can I achieve that? Do I need mod_rewrite?
Thank you for your help!
aphatschi
 
Posts: 2
Joined: 08. November 2010 17:28

Re: Blocking parent directory but not child direcotries

Postby basti2485 » 17. November 2010 13:10

Put an empty index.html Document into the parent directory.
basti2485
 
Posts: 52
Joined: 02. May 2008 18:13

Re: Blocking parent directory but not child direcotries

Postby Altrea » 17. November 2010 13:35

basti2485 wrote:Put an empty index.html Document into the parent directory.

Thats no solution for the problem. The index.html file just prevents the Apache to list out folderstructure. This can be done by Apache configuration too.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8294
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Blocking parent directory but not child direcotries

Postby basti2485 » 18. November 2010 17:14

Yes, but you cannot see the directory any longer.
basti2485
 
Posts: 52
Joined: 02. May 2008 18:13

Re: Blocking parent directory but not child direcotries

Postby aphatschi » 19. November 2010 11:01

thank you for your help!
an empty index.html is perhaps the quick and dirty way.
but how would a proper solution look like?
aphatschi
 
Posts: 2
Joined: 08. November 2010 17:28

Re: Blocking parent directory but not child direcotries

Postby WilliL » 19. November 2010 13:07

have a look to Options Directive "-Indexes"
http://httpd.apache.org/docs/2.0/en/mod/core.html
Willi
WilliL
 
Posts: 661
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1


Return to Apache

Who is online

Users browsing this forum: No registered users and 3 guests