Otomatis Http ke Https
Hallo para mimin server,
Ini ada contoh htaccess buat ngerubah http ke https, hari gini masih http?, simpan kode dibawah ini dengan nama .htaccess lalau taruh di folder root website.
RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain to use www. RewriteCond %{HTTP_HOST} !^www. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
~ sekian
[…] (optional) tambahkan fungsi untuk redirect ke https seperti pada artikel sebelumnya Otomatis Http ke Https: […]