Apache2 阿帕奇唐';t重写index.php和其他文件

Apache2 阿帕奇唐';t重写index.php和其他文件,apache2,rewrite,Apache2,Rewrite,我的重写规则有问题,我想要http://example.com/b/abc调用banner.php?b=abc,这很有效。但是当我输入http://example.com/index.php?mode=mybanners它将调用banner.php?b=index.php?mode=mybanner(或类似的东西)。我的.htacces文件: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / Rew

我的重写规则有问题,我想要
http://example.com/b/abc
调用
banner.php?b=abc
,这很有效。但是当我输入
http://example.com/index.php?mode=mybanners
它将调用
banner.php?b=index.php?mode=mybanner
(或类似的东西)。我的
.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>

重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-f
重写规则b/?(.+)$./banner.php?b=$1
重写规则i/?(.+)$./banner.php?bi=$1
/index.php
正常交互的一些想法?

尝试以下规则:

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

重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-f
重写cond%{REQUEST_URI}^/index.php
重写规则b/?(.+)$./banner.php?b=$1