Php Mod Rewrite复制查询
我试图重写一个页面,但我得到了一个重复的查询Php Mod Rewrite复制查询,php,url,mod-rewrite,url-rewriting,Php,Url,Mod Rewrite,Url Rewriting,我试图重写一个页面,但我得到了一个重复的查询 http://www.website.com/settings/index.php?page=account 改写为: http://www.website.com/settings/account 所以我的问题是,当我在页面上使用服务器验证时,我重定向到设置/account?valid=failed,但不幸的是,我得到了: http://www.website.com/settings/account?valid=false&page=accoun
http://www.website.com/settings/index.php?page=account
改写为:
http://www.website.com/settings/account
所以我的问题是,当我在页面上使用服务器验证时,我重定向到设置/account?valid=failed
,但不幸的是,我得到了:
http://www.website.com/settings/account?valid=false&page=account
这是我的重写代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9-]+)?$ index.php?page=$1 [L,QSA]
重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^([A-Za-z0-9-]+)?$index.php?页面=$1[L,QSA]
错误在php中。修改不是问题所在 你想让它看起来像什么?对不起,应该加上这个。应该是:
http://www.website.com/settings/acount?valid=false
您的问题出在PHP内部,而不是htaccess。那么,您有没有建议我如何构造用于验证的重定向url?我尝试了$SERVER['REQUEST\u URI']。“?valid=false”
和htmlentities($SERVER['REQUEST\u URI'])。?valid=false
,但结果仍然相同。