https://sir.kr관련 채택완료
http로 접속을 해도 https로 자동으로 바뀌도록 해놓았습니다.
그런데 냑은 sir.kr이라고 쳐도 https://sir.kr" target="_blank">https://sir.kr 로 들어가고
www.sir.kr 이라고 쳐도 https://sir.kr" target="_blank">https://sir.kr 로 들어가지네요.
www. 는 삭제된채로 말이죠.
저도 그렇게 하고싶은데 .htaccess를 어떻게 손보면 되나요?
지금은 이렇게 해놓았습니다.
</p>
<p><IfModule mod_rewrite.c></p>
<p>RewriteEngine On</p>
<p>RewriteCond %{HTTPS} off</p>
<p>RewriteRule (.*) <a><a href="https://%{HTTP_HOST}%{REQUEST_URI}" target="_blank" rel="noopener noreferrer">https://%{HTTP_HOST}%{REQUEST_URI}</a></a> [R=301,L]</p>
<p></IfModule></p>
<p>
답변 1개
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1%" target="_blank">https://%1%{REQUEST_URI} [R=301,QSA,NC,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%" target="_blank">https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://도메인%{REQUEST_URI} [L,NE,R=301]
</IfModule>
둘 중 하나 사용하시면 됩니다.
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인