저는 최근 Windows 서버에서 godaddy, linux, cpanel 서버로 전환했습니다. 나는 htaccess와 goos 아니에요 그리고 나는이 일을 다소 간단한 일이되어야한다고 생각하지만, 나는 그것을 올바르게 할 수 없습니다.htaccess - www가 아닌 www를 https로 리디렉션합니다.
내 SSL 인증서는 https : www.mydomain.com과 같은 사이트에서 작동하도록 설정되었지만 www가 아닌 사이트에서는 작동하지 않습니다.
나는 모든 트래픽이 HTTPS에오고 싶은: example.com/any-folder/any-file HTTPS로 리디렉션 :
모든 트래픽 www.example.com/any-folder/any-file에 오는 http : example.com/any-folder/any-file은 http : www.example.com/any-folder/any-file로 리디렉션되었습니다.
도움을 주셔서 감사합니다. 이 내 htaccess로 파일은 지금이 행동에 대한 이유는
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
모든 요청을 재 작성하는 것입니다
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
[HTTPS www가 htaccess로에 www가 아닌 HTTP에서 리디렉션]의 중복 가능성 (http://stackoverflow.com/questions/17453412/redirect-to -http-non-www-to-https-www-htaccess) – Sumurai8
가능한 중복을 시도했지만 모든 URL을 https로 리디렉션했습니다. 여기 내가 시도한 것 : 'RewriteEngine On' 'RewriteCond % {HTTP_HOST}!^www \. [NC]' 'RewriteRule^(. *) $ http://www.domain.com/$1 [L, R = 301]' 'RewriteCond % {HTTPS} off' 'RewriteRule^(. *) $ https://www.domain.com/$1 [L, R = 301]' – Tom
알다시피 주석의 코드는 실제로 작동하지 않습니다. 대신에 추가 정보가 있으면 질문을 편집하십시오 ;-) – Sumurai8