You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/12/15 08:36:50 UTC

DO NOT REPLY [Bug 46396] New: RewriteRule / RewriteCond don't interpolate server variables in pattern regex

https://issues.apache.org/bugzilla/show_bug.cgi?id=46396

           Summary: RewriteRule / RewriteCond don't interpolate server
                    variables in pattern regex
           Product: Apache httpd-2
           Version: 2.2.10
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: p.ustyugov@inets.ru


I have vhost like this structure:

/www/some_host/htdocs - doc root
/www/some_host/htdocs/usr/user1 - user1 dir
/www/some_host/htdocs/usr/user2 - user2 dir 
/www/some_host/htdocs/usr/user3 - user3 dir
...

I use authorization for this vhost, and try restrict every 
autorized user inside his user dir. User_name correspond with dir_name.

I use next simple .htaccess file for my vhost:
=======================================
Order Allow,Deny
Allow from All

AuthType Basic
AuthName "Some Secured Area"
AuthUserFile /www/some_host/usr.passwd
Require valid-user
Satisfy All

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_USER} !^$
RewriteRule !^/usr/%{REMOTE_USER}/ /usr/%{REMOTE_USER}/ [R]
=======================================
If user try to get out from own dir, server forcibly redirect him to correct
dir.
But, this rules don't work, because mod_rewrite not interpolate server
variables in pattern.

If i user next rules (rule block for every user), it's work fine:
...
RewriteCond %{REMOTE_USER} ^user1$
RewriteRule !^/usr/user1/ /usr/user1/ [R]
RewriteCond %{REMOTE_USER} ^user2$
RewriteRule !^/usr/user2/ /usr/user2/ [R]
RewriteCond %{REMOTE_USER} ^user3$
RewriteRule !^/usr/user3/ /usr/user3/ [R]
...
But, for hundred users i need write minimum two hundreds rules ...


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46396] RewriteRule / RewriteCond don't interpolate server variables in pattern regex

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46396


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Ruediger Pluem <rp...@apache.org>  2008-12-14 23:51:28 PST ---
Your configuration approach is wrong. Bugzilla is no user support forum, but
for reporting bugs. Please post your question to users@httpd.apache.org.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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