update regex remap docs
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/49111ee8 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/49111ee8 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/49111ee8 Branch: refs/heads/5.0.x Commit: 49111ee87aba994548cf06be7d4255719cefb2f7 Parents: a2c2ded Author: James Peach <jpe...@apache.org> Authored: Wed Dec 4 20:16:55 2013 -0800 Committer: James Peach <jpe...@apache.org> Committed: Tue Dec 10 09:05:31 2013 -0800 ---------------------------------------------------------------------- doc/reference/plugins/regex_remap.en.rst | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49111ee8/doc/reference/plugins/regex_remap.en.rst ---------------------------------------------------------------------- diff --git a/doc/reference/plugins/regex_remap.en.rst b/doc/reference/plugins/regex_remap.en.rst index a98107b..0b8bb70 100644 --- a/doc/reference/plugins/regex_remap.en.rst +++ b/doc/reference/plugins/regex_remap.en.rst @@ -27,12 +27,15 @@ To use this plugin, configure a remap.config rule like :: map http://a.com http://b.com @plugin=regex_remap.so @pparam=maps.reg -The parameter with the file name is always required, and the regular -expressions within are evaluated sequentially from the first to the -last. When a regular expression is positively matched against a request -URL, evaluation is stopped and the rewrite rule is applied. If none of -the regular expressions are a match, the default destination URL is -applied (``http://b.com`` in the example above). +The file name parameter is always required. Unless an absolute path +is specified, the file name is assumed to be a path relative to the +Traffic Server configuration directory. + +The regular expressions listed in the configuration file are evaluated +sequentially. When a regular expression is positively matched against +a request URL, evaluation is stopped and the rewrite rule is applied. +If none of the regular expressions are a match, the default destination +URL is applied (``http://b.com`` in the example above). An optional argument (``@pparam``) with the string "``profile``\ " will enable profiling of this regex remap rule, e.g. :: @@ -66,7 +69,6 @@ like :: GET/path?query=bar - The methods are always all upper-case, and always followed by one single space. There is no space between the method and the rest of the URL (or URI path). @@ -81,11 +83,6 @@ the option 'matrix-parameters', e.g. :: ... @pparam=maps.reg @pparam=matrix-parameters -The config file (``maps.reg`` above) can be placed anywhere, but unless -you specify an absolute path (as above), it will default to :: - - /usr/local/etc/regex_remap - A typical regex would look like :: ^/(ogre.*)/more http://www.ogre.com/$h/$0/$1 @@ -110,6 +107,12 @@ on the right hand side during evaluation :: $c - The cookie string from the request $i - The client IP for this request +.. note:: + + The ``$0`` substitution expands to the characters that were + matched by the regular expression, not to the entire string that + the regular expression was matched against. + You can also provide options, similar to how you configure your remap.config. The following options are available ::