Tanya donk redirect ssl yang pakai php


Status
Not open for further replies.
Buat file .htaccess kemudian copy script berikut ke file .htaccess

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
 
Buat file .htaccess kemudian copy script berikut ke file .htaccess

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
 
Kalau webnya pakai cloudflare flexible SSL disarankan pakai ini biar ga error:

Code:
# memastikan web diakses dengan https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 
pastikan file .htaccess nya pakai tanda titik (dot) didepannya

.htaccess <= benar
htaccess <= salah
htaccess.txt <= salah

jangan lupa di change permissionnya pakai :
chmod 644 .htaccess
 
Status
Not open for further replies.
Back
Top