httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <rob...@profundis.nu>
Subject Re: RewriteMap
Date Thu, 01 Aug 2002 10:45:38 GMT
Werner Schalk wrote:
> Hi,
>
> the files has the following permissions:
> -rw-r--r--    1 root     staff         311 25. Dez 11:56 userdir.txt
>
> I changed it to $1 but it did not work out
> again:
>
> 192.168.0.4 - - [01/Aug/2002:12:32:32 +0200]
> [192.168.0.1/sid#80b8e10][rid#814e6a0/initial] (2) rewrite
> /~joe.average/ ->
> 192.168.0.4 - - [01/Aug/2002:12:32:32 +0200]
> [192.168.0.1/sid#80b8e10][rid#814e6a0/initial] (2) local path result:
> 192.168.0.4 - - [01/Aug/2002:12:32:32 +0200]
> [192.168.0.1/sid#80b8e10][rid#814f9f0/initial/redir#1] (2) init rewrite
> engine with requested uri /error/HTTP_BAD_REQUEST.html.var
>
> To me it looks like he does not
> read the userdir.txt file at all
> because he doesn't what what to rewrite.
> So again these are my configs:
>
> RewriteEngine On
> RewriteMap user-dir txt:/usr/local/apache2/conf/userdir.txt
> RewriteRule ^/~(.*) ${user-dir:$2} #$1 did not work either!

You shall use $1 as it is the first group you define; there is no 2nd. And I
think your problem is that you match all characters following the tilde (~).
Apache will probably append a slash after that, so you should have something
more like:

RewriteRule  ^/~([^/]+)/(.*)$ ${user-dir:$1}/$2

Which would first group the user in $1, and everything that follows the
slash in $2.

I have never used the rewrite engine, just know some regexp, so I'm not 100%
it will work.

Regards,
Robert Andersson.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message