0

我的 .htaccess 文件中有这个:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test/
RewriteCond %{REQUEST_URI} !(panel/index.php)
RewriteRule ^panel/(.*)$    panel/index.php/$1/ [L]
</IfModule>

我想隧道所有包含panel/(.*)to的链接来panel/index.php控制它们。

上述规则有效,除非 url 是http://localhost/test/panel/! 它重定向到:

http://localhost/test/panel/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/

需要帮助。

4

1 回答 1

1

尝试这个

 <IfModule mod_rewrite.c>
    RewriteEngine On
    #skip rewrite for  index.php
    RewriteRule ^panel/index.php(.*)$ - [S=1,L]
    RewriteRule ^panel/(.*)$    panel/index.php/$1/ [L]
 </IfModule>
于 2013-04-15T20:05:02.150 回答