You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Corin Langosch <co...@gmx.de> on 2004/08/15 13:20:24 UTC

[users@httpd] directory and regex

Hi all,

i think there's a bug in the regex stuff in the latest apache 1.3.x.
im using the latest debian package.

the code:
<Directory ~ ".*">
...
</Directory>
works. the statements in the section always get applied, as desired.

the code:
<Directory ~ ".*$">
...
</Directory>
does NOT works. the statements in the section never get applied :-(((
(but it should also always!)

what i really wanted to do is only allow acces to a directory,
but not to its sub-directories. doing it like above doesn't work :-(((
<Directory ~ "/htdocs/onlyme$">
...
</Directory>

what works is:
<Directory ~ "/htdocs/onlyme">
...
</Directory>
...but also gives all the sub-dirs access, which is not
what i want to do. so i think there's a bug with the $ char in the
regex apache code :-(

Thanks for your help,
Corin


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] directory and regex

Posted by Joshua Slive <js...@gmail.com>.
On Sun, 15 Aug 2004 13:20:24 +0200, Corin Langosch <co...@gmx.de> wrote:

> what i really wanted to do is only allow acces to a directory,
> but not to its sub-directories. doing it like above doesn't work :-(((
> <Directory ~ "/htdocs/onlyme$">
> ....
> </Directory>
> 
> what works is:
> <Directory ~ "/htdocs/onlyme">
> ....
> </Directory>
> ....but also gives all the sub-dirs access, which is not
> what i want to do. so i think there's a bug with the $ char in the
> regex apache code :-(

What are you putting inside the <Directory>?

Once a directive is applied to a particular directory, it
automatically applies to all sub-directories whether or not the
<Directory> section itself matches those directories.  So you probably
need to find another way to solve your problem.  We might be able to
help you with that if you have more details.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] directory and regex

Posted by Brent 'Dax' Royal-Gordon <br...@gmail.com>.
On Sun, 15 Aug 2004 13:20:24 +0200, Corin Langosch <co...@gmx.de> wrote:
> <Directory ~ "/htdocs/onlyme$">
> ....
> </Directory>

Try adding a /? before the $.  I suspect that'll help, but I'm not sure.

-- 
Brent 'Dax' Royal-Gordon <br...@brentdax.com>
Perl and Parrot hacker

There is no cabal.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] directory and regex

Posted by DvDmanDT <dv...@telia.com>.

> Hi all,
>
> i think there's a bug in the regex stuff in the latest apache 1.3.x.
> im using the latest debian package.
>
> the code:
> <Directory ~ ".*">
> ...
> </Directory>
> works. the statements in the section always get applied, as desired.
>
> the code:
> <Directory ~ ".*$">
> ...
> </Directory>
> does NOT works. the statements in the section never get applied :-(((
> (but it should also always!)
>
> what i really wanted to do is only allow acces to a directory,
> but not to its sub-directories. doing it like above doesn't work :-(((
> <Directory ~ "/htdocs/onlyme$">
> ...
> </Directory>
>
> what works is:
> <Directory ~ "/htdocs/onlyme">
> ...
> </Directory>
> ...but also gives all the sub-dirs access, which is not
> what i want to do. so i think there's a bug with the $ char in the
> regex apache code :-(
>
> Thanks for your help,
> Corin
>
Maybe there must be a trailing /? Also, you should probably allow access to
all in that directive, then have another which restricts access to subdirs..
<Directory "/htdocs/onlyme">
Allow From All
</Directory>
<DirectoryMatch "/htdocs/onlyme/(.+?)">
Deny From All
</DirectoryMatch>

// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com

>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org