여기에서 이와 같은 몇 가지 질문을 보았습니다. 나는 이것을 알아낼 수 없다. 내가 www.example.org
또는 http://www.example.org
에 갈 때마다.htaccess를 통해 http로 https를 리디렉션하지 마십시오.
# enable basic rewriting
RewriteEngine on
# enable symbolic links
Options +FollowSymLinks
# Primary Domain - Force the use of "https"
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
# Primary Domain - Force the use of "www"
RewriteCond %{http_host} ^example.org [nc]
RewriteRule ^(.*)$ https://www.example.org/$1 [r=301,nc]
# Primary Domain - .com to .org
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ https://www.example.org/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ https://www.example.org/$1 [R=301,L]
# Primary Domain - .net to .org
RewriteCond %{HTTP_HOST} ^example.net$ [NC]
RewriteRule ^(.*)$ https://www.example.org/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.example.net$ [NC]
RewriteRule ^(.*)$ https://www.example.org/$1 [R=301,L]
은 그래서 리디렉션되지 않습니다 : 여기 내 코드입니다. 이것이 나를 좌절시키는 것입니다. example.org 나 다른 리디렉션 중 하나를 선택하면 작동합니다. 내가 잘못 설정 한거야?
또한 "HTTP_HOST"라고 표시된 경우 그대로 두어도 되나요? 내가 그것을 내 http 호스트로 바꾸려면 어떻게합니까?