You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2011/01/14 17:21:10 UTC
svn commit: r1059058 - /httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
Author: rbowen
Date: Fri Jan 14 16:21:09 2011
New Revision: 1059058
URL: http://svn.apache.org/viewvc?rev=1059058&view=rev
Log:
Provides an example of using expr in a RewriteCond for a commonly-requested recipe.
Modified:
httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml?rev=1059058&r1=1059057&r2=1059058&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Fri Jan 14 16:21:09 2011
@@ -775,6 +775,17 @@ RewriteRule ^index\.html$ newsite.html
<p>If the <em>TestString</em> has the special value <code>expr</code>, the
<em>CondPattern</em> will be treated as a
<a href="../expr.html">ap_expr</a>.</p>
+
+ <p>
+ In the below example, <code>-strmatch</code> is used to
+ compare the <code>REFERER</code> against the site hostname,
+ to block unwanted hotlinking.
+ </p>
+
+ <example>
+ RewriteCond expr "! %{HTTP_REFERER} -strmatch '*://%{HTTP_HOST}/*'"<br />
+ RewriteRule ^/images - [F]
+ </example>
</li>
<li>You can also set special flags for