여러 솔루션을 사용해 보았는데 그 중 아무 것도 작동하지 않는 것으로 나타났습니다. 단지 리디렉션 오류가 발생합니다. HTTPS : HTTP : // www.domain.com.htaccess를 사용하여 http 트래픽을 모두 https 및 www.domain.com으로 리디렉션하는 방법
현재처럼 시작 주소를 모두 이동해야
http://domain.com
http://www.domain.com
https://domain.com
http://alias.com
http://www.alias.com
https://alias.com
:
는 내가 뭘하려고에 대한 HTTPS로 모든 트래픽을 리디렉션 할 수 있습니다 : // www는 https로 리디렉션되지 않습니다. 여기
당신은 www를 제거해야RewriteEngine On
RewriteBase/
# Fix Apache internal dummy connections from breaking [(site_url)] cache
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^mydomain\.com [NC]
RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]
# Exclude /assets and /manager directories from rewrite rules
RewriteRule ^(manager|assets) - [L]
# For Friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^myalias.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www.myalias.ca$
RewriteRule ^/?$ "https\:\/\/mydomain\.com" [R=301,L]
RewriteCond %{HTTP_HOST} ^myotheralias.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www.myotheralias.ca$
RewriteRule ^/?$ "https\:\/\/mydomain\.com" [R=301,L]
모든 요청을 https://mydomain.com으로 리디렉션해야하는 경우 왜 HTTP_HOST가 필요합니까? – MrTux