Url rewrite with mod_jk

In php application I am using the following rewrite rule:

RewriteRule ^test-([0-9]+)\.html$ test.php?id=$1

      

After that, I can access this rule:

http: //localhost/testphp/test-1.html

I get the expected page and the URL in the browser stays the same:

http: //localhost/testphp/test-1.html

But if I set up the same rule with mod_jk:

RewriteRule ^/testjk/test-([0-9]+)\.html$ http://%{SERVER_NAME}/testjk/test.jsp?id=$1

      

then after visiting the page using the rewritten url:

http: //localhost/testjk/test-1.html

The URL in the browser will navigate to:

http: //localhost/testjk/test.jsp? id = 1

Does anyone know how I can make jk one like php one?

+1


source to share


1 answer


I managed to get this to work by changing the rule to the following:



RewriteRule ^/testjk/test-([0-9]+).html$ /testjk/test.jsp?id=$1 [L,PT]

      

+1


source







All Articles