2016-08-30 4 views
0

私のウェブページを見るにはsquarespaceを指していますが、今から私のサーバから私自身のウェブページを管理したいのですが、私のサイトにリダイレクトするDNSを変更すると、多くのリダイレクト。私のサーバでリダイレクトが多すぎます

これは私の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> 
関連する問題