RewriteEngine on # Mengarahkan permintaan dengan awalan "www" ke tanpa "www" RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule .* https://%1%{REQUEST_URI} [L,R=301] # Mengarahkan permintaan HTTP ke HTTPS RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-SSL} !on RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]