title: Tuckey UrlRewriteFilter Not Working With Multiple Conditions for Host Not Equal
body: <p>When my URL is localhost:8080, the rule below for Tuckey UrlRewriteFilter wrongly always results in localhost:8080 redirecting to www.example.com.</p>
  
  <p>That behaviour for seems contrary to Tuckey UrlRewriteFilter reference manual!</p>
  
  <p>What I want is for localhost:8080 to remain unchanged without redirection, to allow testing on local computer.</p>
  
  <p>I wish to avoid unwanted URLs which are NOT at the example.com domain from being indexed by search engines.  The unwanted URLs have a different domain but point to the same/duplicate example.com pages.</p>
  
  <pre><code>&lt;urlrewrite&gt;
      &lt;rule&gt;
          &lt;name&gt;Avoid wrong hostname's pages being indexed by search engines&lt;/name&gt;
  
          &lt;condition name="host" operator="notequal" next="and"&gt;www.example.com&lt;/condition&gt;
          &lt;condition name="host" operator="notequal" next="and"&gt;localhost:8080&lt;/condition&gt;
  
          &lt;from&gt;^/(.*)&lt;/from&gt;
          &lt;to type="permanent-redirect" last="true"&gt;http://www.example.com/$1&lt;/to&gt;
      &lt;/rule&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>Alternative:</strong></p>
  
  <p>I also tried it another way: removing all condition elements, and altering "from" to be:</p>
  
  <pre><code>   &lt;from&gt;^/(^www.example.com|^localhost:8080)(\?.*)?$&lt;/from&gt;
  </code></pre>
  
  <p>i.e. not equal to example.com and not equal to localhost -- but that has same problem.</p>