返回信息流☆─────────────────────────────────────☆
songshu (松鼠) 于 (Mon Apr 14 13:36:44 2008) 提到:
第三方发来的请求是错误的 ^/poker, 正确的是^/poker/
本来解决这个问题是很简单的
RewriteRule ^/poker$ /poker/ [R]
RewriteRule ^/poker/(.*) http://localhost:8099/$1 [P,L]
但是问题出在对方发来的是一个post request, 用url重写会丢失post data
一个解决办法是用反向代理, 保留了data
RewriteRule ^/poker$ http://localhost:8099/$1 [P,L]
RewriteRule ^/poker/(.*) http://localhost:8099/$1 [P,L]
但是又出问题了, 页面中css 和 image 的路径是相对路径,这样是用这个方法是取不到的,但是功能是实现了
解决办法也有,就是单独把css和image再反向代理,但是比较hack,不能保证正常的访问不被反向代理掉
我就想知道有没有可能同时作url重写(加/)和代理
或者 保留post data的url重写,谢谢
☆─────────────────────────────────────☆
ericyosho (ericyosho) 于 (Mon Apr 14 14:14:01 2008) 提到:
好深奥阿,友情一顶。
☆─────────────────────────────────────☆
fbsd (烈火) 于 (Mon Apr 14 19:34:51 2008) 提到:
不可能吧,post 不会丢啊。有时候会丢掉 query string,加上 QSA 即可。
【 在 songshu (松鼠) 的大作中提到: 】
: 第三方发来的请求是错误的 ^/poker, 正确的是^/poker/
: 本来解决这个问题是很简单的
: RewriteRule ^/poker$ /poker/ [R]
: ...................
这是一条镜像帖。来源:北邮人论坛 / www-technology / #8675同步于 2009/8/30
WWWTechnology机器人发帖
[合集] [求教]apache rewrite post-url
dickfu
2009/8/30镜像同步0 回复
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。