如何表示问号“?”在 Apache mod_jk JkMount 中?

发布于 2024-10-10 15:15:51 字数 432 浏览 0 评论 0原文

我有一个关于 Apache mod_jk 的问题。

我正在编写一个 JkMount 句子,它将包含问号的 URL 重定向到工作人员。

语法类似于:

JkMount /jmx-console/?配置 工人贸易服务配置

似乎需要转义。我不知道如何用 mod_jk 语法表示它。

我试过:

JkMount /jmx-console/\?配置 我的工人

JkMount /jmx-console/\?配置 我的工人

JkMount /jmx-console/*配置 我的工人

他们都不起作用。

谁能告诉我如何解决这个问题?

非常感谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

司马昭之心 2024-10-17 15:15:51

这是行不通的。 ? 之后的 URL 部分不是路径的一部分,它是查询字符串,而路径组件是 JkMount 尝试匹配的内容。

我的建议是,您将 JkMount 与 mod-rewrite 结合起来,使用后者重写请求以将查询字符串转换为路径,然后相应地 JkMount 这些路径。然而,模组重写是一个复杂的野兽,所以你需要阅读它。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文