本文介绍了如何重定向到的index.php所有请求,并保留其他GET PARAMS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面就是我这么远:
RewriteEngine叙述上的RewriteCond%{} REQUEST_FILENAME!index.php文件重写规则。*的index.php?URL = $ 0 L]但是,当我去soemthing像 / A?B = C ,然后检查GET参数,可以我只得到 A 为网址和 b 丢失。我如何可以保留?
解决方案 RewriteEngine叙述上的RewriteCond%{} REQUEST_FILENAME!index.php文件重写规则。*的index.php?URL = $ 0 QSA,L]您需要QSA在你重写规则。
Here's what I've got so far:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !index.php RewriteRule .* index.php?url=$0 [L]But when I go to soemthing like /a?b=c and then inspect the GET params, I only get a for url, and b is lost. How can I retain that?
解决方案 RewriteEngine on RewriteCond %{REQUEST_FILENAME} !index.php RewriteRule .* index.php?url=$0 [QSA,L]You need the QSA in your rewrite rule.
更多推荐
如何重定向到的index.php所有请求,并保留其他GET PARAMS?
发布评论