mod-rewrite和$ _ GET变量 [英] Mod rewrite and $_GET variable
本文介绍了mod-rewrite和$ _ GET变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个非常简单的MOD-重写规则:
重写规则^(。*)$的index.php?URL = $ 1 [PT,L]
作为一个例子,它正在改变一个网址 www.mysite.com/a/b
到 www.mysite.com?url=a / B
问题在这里是不允许通过获得的参数来我的PHP。
在如何改造 www.mysite.com/a/b?bar=42&foo=43
到 www.mysite任何线索。 ?COM URL = / A / B和巴= 42安培;富= 43
在此先感谢!
解决方案
重写规则。的index.php?URL = $ 1 [PT,L,QSA]
QSA =查询字符串附加
I have a really simple mod-rewrite rule :
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
As an example, it is transforming an url www.mysite.com/a/b
to www.mysite.com?url=a/b
Issue here is that is does not allow to pass get parameters to my php.
Any clue on how to transform www.mysite.com/a/b?bar=42&foo=43
to www.mysite.com?url=/a/b&bar=42&foo=43
thanks in advance !
解决方案
RewriteRule . index.php?url=$1 [PT,L,QSA]
QSA = Query String Append
这篇关于mod-rewrite和$ _ GET变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文