aboutsummaryrefslogtreecommitdiff
path: root/doc/vmod-dbrw.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/vmod-dbrw.texi')
-rw-r--r--doc/vmod-dbrw.texi16
1 files changed, 13 insertions, 3 deletions
diff --git a/doc/vmod-dbrw.texi b/doc/vmod-dbrw.texi
index 40fc84d..31b15d1 100644
--- a/doc/vmod-dbrw.texi
+++ b/doc/vmod-dbrw.texi
@@ -496,19 +496,29 @@ ORDER BY weight
496@end example 496@end example
497 497
498@noindent 498@noindent
499Furthermore, the @code{url} column can contain a SQL wildcard pattern, 499Furthermore, the @code{url} column can contain a path prefix,
500in which case the query will look like: 500which can be matched using the @code{IN} conditional:
501 501
502@example 502@example
503@group 503@group
504SELECT dest,pattern,value,flags 504SELECT dest,pattern,value,flags
505FROM rewrite 505FROM rewrite
506WHERE host='$host' 506WHERE host='$host'
507AND '$url' like $url 507AND url IN ($(urlprefixes $url))
508ORDER BY weight 508ORDER BY weight
509@end group 509@end group
510@end example 510@end example
511 511
512Notice the use of the @samp{$(urlprefixes $url)}. This invokes the built-in
513@dfn{function} @code{urlprefixes}, which expands to comma-separated
514list of properly quoted pathname prefixes, constructed from its
515argument. For example, if @samp{$url} is @samp{/local/user/local?a=1},
516then the expansion of @samp{$(urlprefixes $url)} is:
517
518@example
519'/local/user/local','/local/user','/local'
520@end example
521
512@node Rewrite 522@node Rewrite
513@chapter The @code{rewrite} Function 523@chapter The @code{rewrite} Function
514 524

Return to:

Send suggestions and report system problems to the System administrator.