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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Felix <[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]