2015-11-07 113 views
0

我的web應用程序有太多redirets錯誤(仍在重新加載頁面)的問題。我嘗試刪除cookies,沒有幫助。由htaccess引起的太多重定向

<IfModule mod_rewrite.c> 
<IfModule mod_negotiation.c> 
    Options -MultiViews 
</IfModule> 

RewriteEngine On 

# Redirect Trailing Slashes... 
RewriteRule ^(.*)/$ /$1 [L,R=301] 

# Handle Front Controller... 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule^index.php [L] 

+0

解決,問題是在PHP代碼。 –

回答

1

嘗試添加:

# turn directory trailing slash off 
DirectorySlash Off 

因爲如果你用的選項添加它,並重寫規則將其刪除並重定向...

+0

仍然拋出相同的錯誤。 –

+0

有人可以幫我嗎? –

0

選擇一個:

<IfModule mod_rewrite.c> 
<IfModule mod_negotiation.c> 

或添加結束

</IfModule> 

嘗試使用:

<IfModule mod_negotiation.c> 
    Options -MultiViews 
</IfModule> 

<IfModule mod_rewrite.c> 
    RewriteEngine On 

    # Redirect Trailing Slashes... 
    RewriteRule ^(.*)/$ /$1 [L,R=301] 

    # Handle Front Controller... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule^index.php [L] 
</IfModule> 
+0

不工作,並且已經存在。 –

+0

你有兩個開頭'',但只有一個''。所以要麼你只打開一個開口,要麼忘記關閉第二個。 – Streetlamp

+0

是的,我現在明白了。在添加''後,現在500頁錯誤出現在頁面上。 –