我们都知道PHP的REQUEST_URI是包括查询字符串的,就是等于浏览器地址栏的内容,但是从apache的文档上看到这个说明
REQUEST_URI
The path component of the requested URI, such as "/index.html". This notably excludes the query string which is available as as its own variable named QUERY_STRING.
意思应该是说查询字符串是独立在QUERY_STRING中的,而REQUEST_URI并不包含在其中,这让我觉得有点困惑,主要是不知道RewriteRule时^(.*)$包不包括查询字符串,例如我有个旧的网址old.com,别人访问 http://old.com/query.php?name=abc 时我要301重写到 http://new.com/query.php?name=abc
RewriteCond %{HTTP_HOST} !^old\.com$ [NC]
RewriteRule ^(.*)$ http://new.com/$1 [R=301,L]
那这个 $1 是指 query.php 还是 query.php?name=abc 呢?如果不包含查询字符串,那我是不是要在 $1 后面在加个 %{QUERY_STRING} ???
------解决方案--------------------
楼主够早的,这么早高手都还没起床了。我也是刚刚起来才看到,先帮你顶一下。
------解决方案--------------------
早晨五点,这是在通宵么?生命是本钱~
mod_rewrite不会,有空研究一下。
------解决方案--------------------
该休息就早点休息啊。。。。。
------解决方案--------------------
通宵么?生命是本钱~
------解决方案--------------------