我们有?在 url 中,ajp 将其转换为 %3F
使用 Mod_jk 连接器,我们将其保存在 /etc/apache2/sites-available 文件中:
RewriteRule /$ /op_ugw/orderportal/home?switchprofile=RecyledPlants [L]
这很好用。 www.recycledplants.com 将带您到达正确的地方。
然而,在 Ubuntu 10.04 服务器上,我们设置 ajp 而不是 mod_jk 。所以我们有
ProxyPass / ajp://10.1.1.1:8009/op_ugw/orderportal/home?switchprofile=RecyledPlants ProxyPassReverse / ajp://10.1.1.1:8009/op_ugw/orderportal/home?switchprofile=RecyledPlants
当我尝试访问recycledplants.randrinc.com(用于测试的URL)时,我收到404错误和
描述:请求的资源(/op_ugw/orderportal/home%3Fswitchprofile=RecyledPlants)不可用。
这 ?已转换为 %3F。
有没有办法阻止 Apache 转换?到 %3F。
希望这是有道理的。 谢谢 安
with the Mod_jk connector we have this in our /etc/apache2/sites-available file:
RewriteRule /$ /op_ugw/orderportal/home?switchprofile=RecyledPlants [L]
This works fine. and www.recycledplants.com will get you to the correct place.
However on Ubuntu 10.04 server we setup ajp instead of mod_jk . so we have
ProxyPass / ajp://10.1.1.1:8009/op_ugw/orderportal/home?switchprofile=RecyledPlants
ProxyPassReverse / ajp://10.1.1.1:8009/op_ugw/orderportal/home?switchprofile=RecyledPlants
When I try to get to recycledplants.randrinc.com (url for testing) I get a 404 error and
description: The requested resource (/op_ugw/orderportal/home%3Fswitchprofile=RecyledPlants) is not available.
the ? has been converted to %3F.
Is there a way to stop Apache from converting the ? to %3F.
Hope this makes sense.
thanks
Ann
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Java Ranch 上得到了一些指导,并且能够弄清楚如何实现。这是我所做的:
好的,这是有效的:
/etc/apache2/sites-available 文件,没有 parms/redirect (只是文件的顶部部分):
<代码>
名称VirtualHost 10.1.1.1:80
ServerAdmin webmaster@localhost
这是当您需要重定向时的样子,在我的例子中,我传递参数并且应用程序执行重定向:
<代码>
名称VirtualHost 10.1.1.1:80
ServerAdmin webmaster@localhost
希望这对某人有帮助。我还在 Amazon 云服务器上运行 Ubuntu 10.04。
格式有点问题,但我想你可以阅读。
安
got some pointers over on Java Ranch and was able to figure it how. Here is what I did:
Ok, here is what works:
/etc/apache2/sites-available file with no parms/redirect (just the top section of the file ):
NameVirtualHost 10.1.1.1:80
ServerAdmin webmaster@localhost
Here is what it looks like when you need to redirect, in my case i am passing parms and the application does the redirecting:
NameVirtualHost 10.1.1.1:80
ServerAdmin webmaster@localhost
Hopes this helps someone. Also I am running on Ubuntu 10.04 on an Amazon cloud server.
Having a little trouble formatting, but I think you can read.
Ann
如果我正确理解你的问题:在 RewriteRule 末尾添加“NE”。
该标志可防止 mod_rewrite 将常用的 URI 转义规则应用于重写结果。通常,特殊字符(例如“%”、“$”、“;”等)将被转义为其对应的十六进制代码(分别为“%25”、“%24”和“%3B”);该标志可以防止这种情况发生。
您可以在 apache mod_rewrite 文档中阅读有关其工作原理的更多信息: http://httpd .apache.org/docs/2.0/mod/mod_rewrite.html
If I understand your question correctly: Add a "NE" to the end of the RewriteRule.
This flag prevents mod_rewrite from applying the usual URI escaping rules to the result of a rewrite. Ordinarily, special characters (such as '%', '$', ';', and so on) will be escaped into their hexcode equivalents ('%25', '%24', and '%3B', respectively); this flag prevents this from happening.
You can read more about how this works in the apache mod_rewrite documentation: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html