Tanya setting redirect https


Status
Not open for further replies.

hositngku1234

Apprentice 2.0
Halo semua saya mau tanya nih. Saya udah selesai setting ssl via cpanel. Skrng tinggal redirectnya aja ke https. Nah saya mau tny untuk setting ssl 2 domain itu gmn ya? 2 domain ini yang saya maksud 1 domain utama 1 subdomain. Jadi waktu ketik urlnya otomatis https gt.

Apakah sama caranya seperti ini ?

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 
iy, kode tersebut dimasukkan ke .htaccess webnya
 
Kalau di nginx atau litespeed diletakkan dimana ?
 
Halo semua saya mau tanya nih. Saya udah selesai setting ssl via cpanel. Skrng tinggal redirectnya aja ke https. Nah saya mau tny untuk setting ssl 2 domain itu gmn ya? 2 domain ini yang saya maksud 1 domain utama 1 subdomain. Jadi waktu ketik urlnya otomatis https gt.

Apakah sama caranya seperti ini ?

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Pake ini juga di .htaccess keren :
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTP_HOST} ![0-9]$ [NC]
RewriteRule ^(. *
)$ https://www.%{HTTP_HOST}/$1 [L,R=301]
 
Guys, kalau kondisinya seperti ini:

-- Kode .htaccess whmcs --
Code:
RewriteEngine On

# Announcements
RewriteRule ^announcements/([0-9]+)/[a-z0-9_-]+\.html$ ./announcements.php?id=$1 [L,NC]
RewriteRule ^announcements$ ./announcements.php [L,NC]

# Downloads
RewriteRule ^downloads/([0-9]+)/([^/]*)$ ./downloads.php?action=displaycat&catid=$1 [L,NC]
RewriteRule ^downloads$ ./downloads.php [L,NC]

# Knowledgebase
RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+\.html$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC]
RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php?action=displaycat&catid=$1 [L,NC]
RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC]

# OpenID Discovery Document (http://openid.net/specs/openid-connect-discovery-1_0.html)
RewriteRule ^.well-known/openid-configuration ./oauth/openid-configuration.php [L,NC]

Apakah tinggal ditambahkan code ini?.:

Code:
# memastikan web diakses dengan https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

** Btw kondisinya adalah subdomain **
 
Status
Not open for further replies.
Back
Top