apache的rewrite对php与html的不同

apache的rewrite对php与html的不同

Filed under: IT |  

今天碰到个很奇怪的问题,由于想撤换掉php环境,所以有些文件将php更改成了纯html页面
本以为没啥事,毕竟更换的都是比较简单的东东,可是还是出问题了,HK那边说后台看到的数据有一项是关于agent的有错误

赶紧查看程序,测试没发现啥问题啊,经过排查,问题出在apache的rewrite规则上,以前的规则是:
RewriteRule ^/inquiry(.*) /script/setagent.php?agent=$1 [L]
这样获得的agent很正常,可是换成html后,规则相应的换成:
RewriteRule ^/inquiry(.*) /script/setagent.html?agent=$1 [L]
得到的agent参数为空,可是如果直接执行/script/setagent.html?agent=xxx,是可以将agent值传递过去的,原因只可能出在RewriteRule上了

查看apache手册,将规则更换成:
RewriteRule ^/inquiry(.*) /script/setagent.html?agent=$1 [R,QSA]
能够正常工作了,很奇怪,难道php与html差别这么大?
真实的原因有空再查找一下,或者有谁知道的告诉我一声,谢谢了先 :-)


Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

If you want to leave a feedback to this post or to some other user´s comment, simply fill out the form below.

(required)

(required)