logo
  • Home
  • Pemrograman
    • Website
      • PHP
      • MySQL
      • Ajax
      • CSS
      • JavaScript
      • HTML
    • Framework
      • Laravel
      • Lumen
      • Yii2
  • Sistem Operasi
    • Linux
    • Android
    • Windows
  • Kehidupan
    • Cinta
    • Ga Jelas
  • Home
  • Pemrograman
    • Website
      • PHP
      • MySQL
      • Ajax
      • CSS
      • JavaScript
      • HTML
    • Framework
      • Laravel
      • Lumen
      • Yii2
  • Sistem Operasi
    • Linux
    • Android
    • Windows
  • Kehidupan
    • Cinta
    • Ga Jelas

Otomatis Http ke Https

17 Dec 2014 by Nasrul Hadi 1 Comments

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

Categories : Linux, Tutorial, Ubuntu
Tags : apache, htaccess, linux, php, server, yii
Nasrul Hadi

Sudah menikah, dan sekarang jadi bapak rumah tangga. Contact: nasrul[at]arekmedia.com

Related Post

SSL Gratis dari Let’s Encrypt!

SSL Gratis dari Let’s Encrypt!

09 Sep 2016
Kirim Email Di Lumen 5.2 Menggunakan Mandrill

Kirim Email Di Lumen 5.2 Menggunakan Mandrill

09 Apr 2016
5 Plugin Wajib di WordPress

5 Plugin Wajib di WordPress

23 Oct 2015

1 thought on “Otomatis Http ke Https”

  1. SSL Gratis dari Let's Encrypt | Sementara Itu...
    said on 9 September 2016

    […] (optional) tambahkan fungsi untuk redirect ke https seperti pada artikel sebelumnya Otomatis Http ke Https: […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

latestwid-img

Cara cepat “Save All” di Sublime Text 3

6 May 2020
latestwid-img

Password default modem Huawei HG8245A Indihome terbaru 2020

4 May 2020
latestwid-img

Percayakan Server dan Domain Kamu pada Ahlinya

30 April 2020
latestwid-img

Cara menghubungkan folder sharing Windows 10 dengan VLC di Android TV

23 April 2020
latestwid-img

Modem Indihome Kena Hack!

15 May 2017

Recent Comments

  • mahasiswacode on Kirim Email Di Lumen 5.2 Menggunakan Mandrill
  • Firman on Modem Indihome Kena Hack!
  • anil on Modem Indihome Kena Hack!
  • philtyphils on Kirim Email Di Lumen 5.2 Menggunakan Mandrill
  • Muhamad Husein on SSL Gratis dari Let’s Encrypt!

Archives

  • May 2020
  • April 2020
  • May 2017
  • September 2016
  • April 2016
  • October 2015
  • May 2015
  • April 2015
  • December 2014
  • November 2014
  • October 2012
  • March 2012
  • July 2011
  • June 2011
  • May 2011
Dibuat untuk memberi manfaat ❤