0
<rule>
    <from>^/asd/(.*)/$</from>
    <to type="temporary-redirect">%{context-path}/?asd=$1</to>
</rule>

my website is hosted as myapp.com/testing and my jetty context is dev

so myapp.com/testing/dev/

but when I try myapp.com/testing/dev/asd/123/

instead of myapp.com/testing/dev/?asd=123

I get redirected to myapp.com/dev/?asd=123

I 'm using v 4.0 http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/4.0/index.html

2
  • What do you mean "my website is hosted as myapp.com/testing"? What is the "/testing"? The context path is right, you must investigate on what is the /testing part of your application.
    – Davide
    Apr 1, 2015 at 13:06
  • I have local jetty server on port 8080, and my sys admin is redirecting myapp.com/testing to my localhost:8080
    – user494461
    Apr 1, 2015 at 13:07

1 Answer 1

0

You have 2 things mucking about with your request.

Your rewrite filter is at odds with whatever you have in front of Jetty (hardware or software that is converting browser (http client) requests to myapp.com/testing/dev/ to jetty's myapp.com/dev/. Jetty isn't aware of the extra /testing/ part of the path, so your rewrite filter cannot add that extra /testing/ piece for its 302 redirect.

Either you'll need to make the product in front of Jetty smart enough to rewrite the Location response header, or you'll need to adjust your rewrite filter to include the extra path information that the product in front of Jetty is aware of.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.