[Ask] Force https://www. in generic way

Status
Not open for further replies.

Rizal Depok

Poster 1.0
Assalamualaikum, siang semua member selamat berakhir pekan
Izin nanya, saya lg buat website dengan CI.
Di base URL saya tulis https://domain.com.
Di .htaccess juga saya sudah buat biar di URL browser nanti selalu pakai https://
Nah ceritanya newbie mau kaya website DWH, di URL lengkap https://www.domain.com, itu gmna ya caranya? Newbie udah ikutin cara pada link Disini , bisa jadi https://www.domain.com tapi ada beberapa file css yg ga bisa load trus cuma pada home page ajja bisanya, kalo pindah ke page lain hasilnya not allowed... by litespeed gt
Mohon bimbingan newbie tuan tuan:77:
 

Rintishosting

Apprentice 1.0
Verified Provider
coba dengan cara ini tuan...

di .htaccess nya di edit ini

RewriteBase /
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$
https://www.domainanda.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^destinasian.com$
RewriteRule ^/?$ "https\:\/\/www\.domainanda\.com" [R=301,L]

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
#RewriteRule ^([a-z]+)\/?$ $1.php [NC]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html

#RewriteRule ^([a-z]+)\/?$ $1.html [NC]
NB : ganti www.domainanda.com dengan nama domain anda tuan.

semoga membantu....salam Rintishosting :77:
 

Rizal Depok

Poster 1.0
Force to https://www. nya dah bisa tuan tapi saat saya buat form trus saya jalankan fungsi CI $this->input->post() hasilnya null.
Kalo GAK pakai www hasilnya normal semua data dr form terbaca.
Sebetulnya penting ga sih tuan pakai www itu?
:77:
 

hendranata

Hosting Guru
Verified Provider
umumnya pake www.
tapi terserah mau pake atau ga sama aja hasilnya
 

Rizal Depok

Poster 1.0
[resolved]
saya kan pakai CI tuan
di base url saya tulis https://domain.com

di .htaccess
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

moga bisa manfaat buat yg lain:103:
 
Status
Not open for further replies.

    
Top