2014-04-03 51 views
0

我如何重寫我已經試過這一切文件,但一個「logout.php」 ,但它只是給的我404:htaccess重寫所有,但一個PHP文件?

<IfModule mod_rewrite.c> 
    RewriteEngine on 
# You may need to uncomment the following line if rewrite fails to work 
# RewriteBase must be setup to base URL of your aMember installation without 
# domain name 
    RewriteBase /amember4 
    RewriteCond %{REQUEST_URI} !^/logout\.php$ [NC] 
    RewriteRule ^public public.php [L] 
    RewriteRule ^js.php js.php [L] 
    RewriteRule !\.(js|ico|gif|jpg|png|css|swf|csv|html)$ index.php 
</IfModule> 
+0

「logout.php」?你確定? – arkascha

+0

是的我確定我剛剛注意到它已設置爲登錄我現在正在更新! – vimes1984

+0

好吧,那看起來不同:-) – arkascha

回答

2

的的RewriteCond僅適用於下一個重寫規則。所以你必須重複它或在這種情況下只是在第三個重寫規則之前將其移下來:

<IfModule mod_rewrite.c> 
    RewriteEngine on 

    RewriteBase /amember4 
    RewriteRule ^public public.php [L] 
    RewriteRule ^js.php js.php [L] 
    RewriteRule ^logout.php logout.php [L] 
    RewriteCond %{REQUEST_URI} !^/logout\.php$ [NC] 
    RewriteRule !\.(js|ico|gif|jpg|png|css|swf|csv|html)$ index.php 
</IfModule> 
+0

有用,但我仍然得到一個404 ... – vimes1984

+0

@ vimes1984是您的文件logout.php在amenber4目錄? –

+0

是的,現在我刪除這個htaccess它打的是正確的文件... – vimes1984

相關問題