Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Mod Rewrite复制查询_Php_Url_Mod Rewrite_Url Rewriting - Fatal编程技术网

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
,但结果仍然相同。