title: URLRewriteFilter rule append to url 2 times
body: <p>I am facing some weird issue . Executing one rule ( last rule ) is putting to url to times before forwarding which is giving me 404 error .  </p>
  
  <p>web.xml content </p>
  
  <pre><code>    &lt;filter&gt;
    &lt;filter-name&gt;UrlRewriteFilter&lt;/filter-name&gt;
    &lt;filter-class&gt;org.tuckey.web.filters.urlrewrite.UrlRewriteFilter&lt;/filter-class&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;logLevel&lt;/param-name&gt;
      &lt;param-value&gt;DEBUG&lt;/param-value&gt;
    &lt;/init-param&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;UrlRewriteFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
    &lt;!-- FORWARD dispatcher will keep on parsing requests through rule until
       atleast one rule is applied . It sometime may lead into infinite loop
       --&gt; 
    &lt;!--    &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;  --&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>My rules</p>
  
  <pre><code>&lt;rule&gt;
      &lt;name&gt;DepreatedUrls&lt;/name&gt;
      &lt;from&gt;(/my/url2|/my/url3)&lt;/from&gt;
      &lt;set type="status"&gt;410&lt;/set&gt;
      &lt;to last="true"&gt;%{context-path}/error/410.html&lt;/to&gt;
  &lt;/rule&gt;
  
  &lt;rule&gt;
      &lt;name&gt;AllRemainingRequests&lt;/name&gt;
      &lt;note&gt;
          This rule will block all other requests and return http error
          404 ( not supported ) and custom error message .
      &lt;/note&gt;
      &lt;from&gt;(.*)&lt;/from&gt;
      &lt;set type="status"&gt;404&lt;/set&gt;
      &lt;to last="true"&gt;/error/410.html&lt;/to&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>All other rules are executing fine . Every rule is last rule ( last="true") .
  But when last rule is executed it forwards the request to 
  /error/410.html/error/410.html</p>
  
  <p>I have removed most of the rule definition to keep it simple . Following is the debug logs  </p>
  
  <pre><code>Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
  INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: AllRemainingRequests (rule 8) run called with /some-content
  Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
  INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
  Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
  INFO: org.tuckey.web.filters.urlrewrite.SetAttribute DEBUG: set Set status null 404 called
  Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
  INFO: org.tuckey.web.filters.urlrewrite.SetAttribute DEBUG: setting status
  Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
  INFO: org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to be forwarded to /error/410.html/error/410.html
  Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
  INFO: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last
  </code></pre>