简体   繁体   中英

How to represent question mark '?' in Apache mod_jk JkMount?

I have a question regarding mod_jk of Apache.

I am writing a JkMount sentence which redirect a URL that contains a question mark to a worker.

The syntax is something like:

JkMount /jmx-console/?configuration worker-tradeservice-configuration

However, the question mark seems need to be escaped. I don't know how to represent it in the mod_jk syntax.

I tried:

JkMount /jmx-console/\\?configuration myworker

JkMount /jmx-console/\\?configuration myworker

JkMount /jmx-console/*configuration myworker

And all of them don't work.

Can anyone tell me how to solve this?

Many thanks.

This isn't going to work. The part of the URL after the ? is not part of the path, it's the query string, and the path component is what JkMount tries to match against.

My suggestion is that you combine JkMount with mod-rewrite, using the latter to rewrite the requests to convert query strings into paths, and then JkMount those paths accordingly. Mod-rewrite is a complex beast, though, so you'll need to read up on that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM