Force HTTP to HTTPS manually
- From apache setting
a2enmod rewrite
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
- From .htaccess
a2enmod rewrite
Buat file .htaccess dengan isi:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
Leave a Reply