RewriteCond comparing two variables in Apache htaccess
<p>I would like to have a <code>rewritecond</code> that gets <code>true</code> if two variables <code>HTTP_ORIGIN</code> and <code>HTTP_HOST</code> are equals. I tried</p>

<pre><code>RewriteCond %{HTTP:Origin} ^http://%{HTTP_HOST}(/|$)
</code></pre>

<p>But despite Netbeans syntactic color, it appears that Apache is not replacing <code>%{HTTP_HOST}</code> by its value. I guessed it because</p>

<pre><code>RewriteCond %{HTTP:Origin} ^http://cnfr005554(/|$)
RewriteCond %{HTTP_HOST} =cnfr005554
</code></pre>

<p>Works.</p>

<p>So how can I test that the two variables <code>%{HTTP:Origin}</code> and <code>%{HTTP_HOST}</code> are equals? (and yes, it's for applying OWASP's guidelines to mitigate XSRF)</p>