【问题标题】:problem in apache httpd.conf with question mark characterapache httpd.conf 中带有问号字符的问题
【发布时间】:2011-05-06 03:57:13
【问题描述】:
【问题讨论】:
标签:
apache2
httpd.conf
url-encoding
【解决方案1】:
来自ProxyPass 的文档:
url is a partial URL for the remote server and cannot include a query string.
在您的示例中,stub=stub 是查询字符串。 %3F 替换是作为URL encoding 的一部分完成的。
您可以代理到一个 URL,然后将其重定向到最终目的地(使用查询字符串),例如:
ProxyPass /something http://localhost:9080/proxy
RewriteEngine on
RewriteRule ^/proxy /StubEndpoint?stub=stub
这应该会导致任何以 /something 开头的 URL 返回重定向到 StubEndpoint?stub=stub。但是我自己没有测试过。
【解决方案2】:
我喜欢按位置分组。我的工作解决方案是:
<Location /something>
RewriteEngine On
RewriteRule ^ http://localhost:9080/servlet/StubEndpoint?stub=stub [P]
</Location>