1 Reply Latest reply on Nov 23, 2009 5:49 AM by Jean-Frederic Clere

    Is there a huge bug in RewriteValve?

    Miroslav Liska Newbie

      hello,

      i would like to demonstrate what I think is a bug in RewriteValve causing me huge probles.

      I want to redirect plain dir names into a script by preserving query parameter. The rewrite rule is very simple:

      RewriteRule ^/(.+)/$ /myscript.jsp?dirname=$1&%{QUERY_STRING}


      Now this is the query string I get for various URLs:

      - www.t.com/aaa/ i get correct query string: "dirname=aaa&"

      - www.t.com/aaa/?bla=1&bla=2 I get incorrect query string: "bla=1&bla=2". The dirname parameter is just not there!

      So if no parameters are present in the URL, all is working fine. If there are any parameters in the URL, only those parameters are sent and the dirname parameter is not added to the query.

      The same problem appears if I swith the rule into
      RewriteRule ^/(.+)/$ /myscript.jps?%{QUERY_STRING}&dirname=$1

      Also I could not solve the problem by matching QUERY_STRING manually (^/(.+)/\??(.*)$)or using the QSA flag, because in these cases I observed the same behaviour.

      Any advice would be very very helpful.