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 *

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

Nasrul Hadi

Social

Recent Posts

latestwid-img

Modem Indihome Kena Hack!

15 May 2017
latestwid-img

SSL Gratis dari Let’s Encrypt!

9 September 2016
latestwid-img

Kirim Email Di Lumen 5.2 Menggunakan Mandrill

9 April 2016
latestwid-img

5 Plugin Wajib di WordPress

23 October 2015
latestwid-img

Mengatasi Space Server Penuh

14 May 2015

Recent Comments

  • philtyphils on Kirim Email Di Lumen 5.2 Menggunakan Mandrill
  • Muhamad Husein on SSL Gratis dari Let’s Encrypt!
  • Ceth on From Nu Mountain with Love
  • SSL Gratis dari Let's Encrypt | Sementara Itu... on Otomatis Http ke Https
  • Abdul Hamid on Kirim Email Di Lumen 5.2 Menggunakan Mandrill

Archives

  • 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

Follow @ Instagram

dibuat di kamar Nasrul untuk dunia.