http or https 둘다 접속될 때 css가 안 깨지게 하려면 어떻게 해야되나요? 채택완료
http or https 둘다 접속될 때 css가 안 깨지게 하려면 어떻게 해야되나요?
현재는 http로 접속할 때는 css가 안 깨지는데
https로 접속하면 css가 깨져서 보안콘텐츠 모두 보기하면 제대로 보이네요
모바일에서는 보안 콘텐츠 모두 보기 버튼도 없어서 다 깨져서 나오고요..
혹시 어떻게 고쳐야될까요?? http https 둘다 써도 잘 출력되게 할 수는 없을까요?
답변 4개
css 주소가 /css/style.css 라고 한다면
<link rel="stylesheet" href="http://aaa.com/css/style.css"> ... http(O) , https(X)
<link rel="stylesheet" href="https://aaa.com/css/style.css"> ... http(O) , https(O)
<link rel="stylesheet" href="/css/style.css"> ... http(O) , https(O) 최선의 선택
댓글을 작성하려면 로그인이 필요합니다.
보통은 http 로 접속할 경우 https로 이동시킵니다.
아래는 virtualhost 설정부분입니다.
</p>
<p><VirtualHost 11.22.33.44:80>
DocumentRoot /home/abc/www
ServerName abc.com
ServerAlias www.abc.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* <a href="https://%{SERVER_NAME}%{REQUEST_URI}" target="_blank" rel="noopener noreferrer">https://%{SERVER_NAME}%{REQUEST_URI}</a> [R,L]
</IfModule>
</VirtualHost>
<VirtualHost 11.22.33.44:443>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /home/abc/www
ServerName abc.com
ServerAlias www.abc.com
ErrorLog logs/abc.com-error_log
CustomLog logs/abc.com-access_log common
SSLEngine on
SSLCertificateFile "/home/abc/www_abc_com.crt"
SSLCertificateKeyFile "/home/abc/ssl.key"
SSLCACertificateFile "/home/abc/www_abc_com.ca-bundle"
</VirtualHost></p>
<p>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인