2012-12-24 52 views
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文件:apache不重寫index.php和其他

<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相互作用正常嗎?

回答

0

試試下面的規則:

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