통채로 http to https
참조 : https://wiki.apache.org/httpd/RedirectSSL
ServerName www.example.com
Redirect permanent / https://secure.example.com/
특정 디렉토리만 http to https
ServerName mysite.example.com
DocumentRoot /usr/local/apache2/htdocs
Redirect permanent /secure https://mysite.example.com/secure
rewrite 이용해서
https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
login form 에서 http to https
$form_loginpage=" method='post' action='https://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."'>";
preg_replace http to https
$url = preg_replace("/http:/","https:",$url);
|