3

我的 httpd.conf 文件中有以下行

ProxyPass /something http://localhost:9080/servlet/StubEndpoint?stub=stub

系统响应

请求的资源 (/servlet/StubEndpoint%3Fstub=stub/) 不可用,即它替代了 ? %3F。我该如何解决这个问题?那个问号似乎被“%3F”取代了,我回来了 404

4

2 回答 2

3

ProxyPass的文档中:

url is a partial URL for the remote server and cannot include a query string.

在您的示例中,stub=stub是查询字符串。%3F 替换是作为URL 编码的一部分完成的。

您可以代理到一个 URL,然后将其重定向到最终目的地(使用查询字符串),例如:

ProxyPass /something http://localhost:9080/proxy
RewriteEngine on
RewriteRule ^/proxy /StubEndpoint?stub=stub

这应该会导致任何以 /something 开头的 URL 返回到 StubEndpoint?stub=stub 的重定向。但是我自己还没有测试过。

于 2010-11-06T23:15:39.693 回答
0

我喜欢在位置分组。我的工作解决方案是:

<Location /something>
    RewriteEngine On
    RewriteRule ^ http://localhost:9080/servlet/StubEndpoint?stub=stub [P]
</Location>
于 2013-09-24T11:32:12.980 回答