Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy isn't my UrlRewriteFilter working on Tomcat?
    text
    copied!<p><strong>Summary</strong></p> <p>I am having trouble getting UrlRewriteFilter up and running on Tomcat.</p> <p><strong>Problem</strong></p> <p>I can only get one of the two rules from the default urlrewrite.xml file to work. I followed the <a href="http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/3.2/index.html#install" rel="nofollow">installation directions</a> without much of a problem and I haven't changed any defaults or messed with the configuration file. </p> <p><strong>Example</strong></p> <p>The outbound rule works: <a href="http://localhost:8080/mysite/rewrite-status" rel="nofollow">http://localhost:8080/mysite/rewrite-status</a> successfully takes me to a description page of my urlrewrite.xml file.</p> <p>But the regular rule doesn't work: <a href="http://localhost:8080/mysite/test/status" rel="nofollow">http://localhost:8080/mysite/test/status</a> does not redirect me to <a href="http://localhost:8080/mysite/rewrite-status" rel="nofollow">http://localhost:8080/mysite/rewrite-status</a>. I get a 404 result.</p> <p>Am I expecting the wrong thing from these rules? What could be wrong?</p> <p><strong>Details</strong></p> <p>Here is the urlrewrite.xml file that comes with the installation:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN" "http://www.tuckey.org/res/dtds/urlrewrite3.2.dtd"&gt; &lt;urlrewrite&gt; &lt;rule&gt; &lt;note&gt; The rule means that requests to /test/status/ will be redirected to /rewrite-status the url will be rewritten. &lt;/note&gt; &lt;from&gt;/test/status/&lt;/from&gt; &lt;to type="redirect"&gt;%{context-path}/rewrite-status&lt;/to&gt; &lt;/rule&gt; &lt;outbound-rule&gt; &lt;note&gt; The outbound-rule specifies that when response.encodeURL is called (if you are using JSTL c:url) the url /rewrite-status will be rewritten to /test/status/. The above rule and this outbound-rule means that end users should never see the url /rewrite-status only /test/status/ both in their location bar and in hyperlinks in your pages. &lt;/note&gt; &lt;from&gt;/rewrite-status&lt;/from&gt; &lt;to&gt;/test/status/&lt;/to&gt; &lt;/outbound-rule&gt; &lt;/urlrewrite&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload