Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] jetty-rewrite.xml: RewriteRule clobbers requestURI

-------- Original message --------
From: Michael Dykman <mdykman@xxxxxxxxx>
Date: 10/04/2014 23:10 (GMT+01:00)
To: jetty-users@xxxxxxxxxxx
Subject: [jetty-users] jetty-rewrite.xml: RewriteRule clobbers requestURI

I am unsure if I am looking at a bug or an expected, if
under-documented feature:

A fragment of my jetty-rewrite.xml:

<New id="Rewrite" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
                        <Set name="rewriteRequestURI">false</Set>
                        <Set name="rewritePathInfo">false</Set>
                        <Set name="originalPathAttribute">requestedPath</Set>

I have a number of rules in there, none of them particularly
complicated.  Most of them are of type 'RewriteRegexRule' although
some of them have been nested into several 'VirtualHostRuleContainer'

I am testing the url

The matching rule in question is defined thus:
<New class="org.eclipse.jetty.rewrite.handler.RewriteRegexRule">
   <Set name="regex">^/v2/(.*)</Set>
   <Set name="replacement">/webdir/index.php</Set>
   <Set name="terminating">true</Set>

which does redirect my request to the requested script (I am am
running Quercus under Jetty) but the RequestUri and the PathInfo have
been clobbered.  I was able to craft a shim to correct those values in
PHP (Quercus is a PHP-on-JVM engine), I am surprised that I had to.
- michael dykman
- mdykman@xxxxxxxxx

May the Source be with you.
jetty-users mailing list

Back to the top