2016-08-30 36 views
0

剛纔我指向方格空間來查看我的網頁,但是現在我想從我的服務器管理自己的網頁,但是當我更改DNS重定向到我的網站時,chrome和safari也說許多重定向。在我的服務器中有太多的重定向

這是我的htaccess:

Options +FollowSymLinks 
Options -Indexes 

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 
    # Submitted by: ElliotHaughin 

    ErrorDocument 404 /index.php 
</IfModule> 
RewriteCond %{HTTP_HOST} ^minutos\.com$ [OR] 
RewriteCond %{HTTP_HOST} ^www\.minutos\.com$ 
RewriteRule ^/?$ "http\:\/\/www\.minutos\.com\/" [R=301,L] 

但我不知道如何解決這個錯誤。

回答

0
RewriteCond %{HTTP_HOST} ^minutos\.com$ [OR] 
RewriteCond %{HTTP_HOST} ^www\.minutos\.com$ 
RewriteRule ^/?$ "http\:\/\/www\.minutos\.com\/" [R=301,L] 

以上是一個無限循環重定向,更改爲:

RewriteCond %{HTTP_HOST} ^minutos\.com$ 
RewriteRule ^/?$ "http\:\/\/www\.minutos\.com\/" [R=301,L] 
0

你的最後301規則運行www和非www和重定向到www因此導致重定向循環。

有這樣說:

Options +FollowSymLinks -Indexes 

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/

    RewriteCond %{HTTP_HOST} ^minutos\.com$ [NC] 
    RewriteRule^http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE] 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 
    # Submitted by: ElliotHaughin 

    ErrorDocument 404 /index.php 
</IfModule>