httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47722] New: Small error in the urlmapping example
Date Sat, 22 Aug 2009 10:05:32 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47722

           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
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: felix.schaefer@tu-dortmund.de


--- Comment #0 from Felix <felix.schaefer@tu-dortmund.de> 2009-08-22 03:05:30 PDT ---
At the end of http://httpd.apache.org/docs/2.3/en/urlmapping.html#user , 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: 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


Mime
View raw message