2015-04-22 40 views
0

我有這樣的代碼在我的htaccess:力HTTPS在htaccess的某個URL(ERR_TOO_MANY_REDIRECTS)

RewriteEngine On 
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC] 

RewriteCond %{HTTPS} !=on 
RewriteCond %{THE_REQUEST} ^[A-Z]+\s/login [NC] 
RewriteRule ^(login) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] 

RewriteCond %{HTTPS} =on 
RewriteCond %{THE_REQUEST} !^[A-Z]+\s/login [NC] 
RewriteRule !^login http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php/$1 

它迫使我/login到HTTPS,而不是HTTP,但事實是,它給了我一個錯誤當我訪問/login。錯誤是

ERR_TOO_MANY_REDIRECTS 

回答

0

你可以試試這個重定向而不是 - 你必須把其中的不理想,但對加方應該做的,你需要與1號線

RewriteRule ^login$ https://yourdomain.com/login [L,R=301] 
+0

我只是什麼絕對URL喜歡https https某個url(/ login) –

+0

更新了我的答案 – Josh