我有一个.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