From: Rich Bowen Date: Fri, 14 Jan 2011 16:21:09 +0000 (+0000) Subject: Provides an example of using expr in a RewriteCond for a commonly-requested recipe. X-Git-Tag: 2.3.11~208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd05d4eac8f2103b5e2bccac3fd77f7ce97f5f6c;p=apache Provides an example of using expr in a RewriteCond for a commonly-requested recipe. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059058 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index fbca1dc83b..60dad4908f 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -775,6 +775,17 @@ RewriteRule ^index\.html$ newsite.html

If the TestString has the special value expr, the CondPattern will be treated as a ap_expr.

+ +

+ In the below example, -strmatch is used to + compare the REFERER against the site hostname, + to block unwanted hotlinking. +

+ + + RewriteCond expr "! %{HTTP_REFERER} -strmatch '*://%{HTTP_HOST}/*'"
+ RewriteRule ^/images - [F] +
  • You can also set special flags for