From fd05d4eac8f2103b5e2bccac3fd77f7ce97f5f6c Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Fri, 14 Jan 2011 16:21:09 +0000 Subject: [PATCH] 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 --- docs/manual/mod/mod_rewrite.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.40.0