httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47722] New: Small error in the urlmapping example
Date Sat, 22 Aug 2009 10:05:32 GMT

           Summary: Small error in the urlmapping example
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Documentation

--- Comment #0 from Felix <> 2009-08-22 03:05:30 PDT ---
At the end of , there
is ans example for user directories:
AliasMatch ^/upages/([a-zA-Z0-9]+)/?(.*) /home/$1/public_html/$2

One could think the regex would only match "/upages/"+$login, maybe followed by
"/"+$somestuff. The problem here is that the question mark makes the "/"
between the 2 matches optional, and you end up with a regex more akin to
"anything that begins with a small letter, a big letter or a number".

Example: trying to access (with the above example) /upages/favicon.ico makes
apache look for a /home/favicon directory.

The improved AliasMatch I came up with, and which should solve the problem,
would be:
AliasMatch ^/upages/([a-zA-Z0-9]+)(/(.*))?$ /home/$1/public_html/$3

This regex matches either "/upages/"+$login+"/"+$somestuff, or
"/upages/"+$login, which I think fits more closely to the intent.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message