2014-04-25 2 views
1

다시 쓰기 규칙에 대한 도움이 필요합니다.http를 https 및 https : // www를 https : //로 리디렉션하는 방법

그래서 내가 원하는 이들 주소 :

http://domain.com 
http://www.domain.com 
https://www.domain.com 

리디렉션 :

https://domain.com 

누군가가 나를 도울 수 있습니까? 당신의 DOCUMENT_ROOT/.htaccess 파일에

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://domain.com/$1 [R,L] 

But it doesnt redirect https://www to https:// 

답변

0

장소이 규칙 :

는 지금은 규칙이

RewriteEngine On 

RewriteCond %{HTTPS} off [OR] 
RewriteCond %{HTTP_HOST} www\. 
RewriteRule^https://domain.com%{REQUEST_URI} [L,R=301,NE] 
+0

야호를! 그 작품. 고맙습니다. :) –

+0

다행입니다. 다행입니다. – anubhava

관련 문제