.htaccess-当我尝试运行url(http:// localhost / public)时,重复参数

时间:2019-03-04 08:49:23

标签: .htaccess

我有一个.htaccess文件,如下所示:

RewriteEngine On
DirectorySlash Off

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^$ index.php [L]

RewriteRule ^([^/]*)$ index.php?link=$1 [QSA,L]
RewriteRule ^([^/]*)/([0-9]+)$ index.php?link=$1&id=$2 [QSA,L]
RewriteRule ^([^/]*)/([a-zA-Z-0-9]+)$ index.php?link=$1&action=$2 [QSA,L]
RewriteRule ^([^/]*)/([0-9]+)/([^/]*)$ index.php?link=$1&id=$2&action=$3 [QSA,L]

RewriteRule !^(index\.php|public/|assets/) [NC,L,F]

RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]

我的问题是,当我尝试运行http://localhost/public时,重复了params链接。运行后,URL为http://localhost/public?link=public&link=public&link=public&link=public&link=public&link=public&link=public&link=public&link=public

请告诉我发生了什么以及如何解决。 Tks

0 个答案:

没有答案