Path name matching
目次
2006/08/24 Update
2002/12/08
Pegasus has two methods for controlling request using pathname.
Path matching in "rewrite
", "passwd
", "allow
"
The path name matching rule used here is very simple. Let P1 and P2 be absolute paths. We define "P1 matches P2" if P1 is deeper that P2.For example,
P1 P2 result /abc / OK /abc /defg NG /abc /abc/ OK /abc/ /abc OK /abc /abc/de NG /abc/de /abc OKwhere "
OK
" means "P1 matches P2".We don't apply any special characters that are used in regular expression or wildcards in shell.
Path name matching in "handler
"
The path name matching rule used in "handler
" is similar to that of the rule used in shell. We can use "*
","?
" and "[ ]
", the meaning is same as that of shell. Usage of "/
" is modified, the symbol is merely a character except an additional rule: "/*/
" matches "/
"Therefore
/netlib/*/index.htmldenotes in shell style expression
/netlib/index.html /netlib/*/index.html /netlib/*/*/index.html /netlib/*/*/*/index.html ...