1

我的重写规则有问题,我想要http://example.com/b/abc调用banner.php?b=abc,它有效。但是当我输入http://example.com/index.php?mode=mybanners它会调用banner.php?b=index.php?mode=mybanners(或类似的东西)。我的.htacces文件:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule b/?(.+)$ ./banner.php?b=$1
    RewriteRule i/?(.+)$ ./banner.php?bi=$1
</IfModule>

一些让/index.php交互正常的想法?

4

1 回答 1

0

尝试以下规则:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteRule b/?(.+)$ ./banner.php?b=$1
</IfModule>
于 2013-01-03T07:32:57.367 回答