_______            ___   ______     _      __
 /_  __(_)___  _____( _ ) /_  __/____(_)____/ /_______
  / / / / __ \/ ___/ __ \/|/ / / ___/ / ___/ //_/ ___/
 / / / / /_/ (__  ) /_/  </ / / /  / / /__/ ,< (__  )
/_/ /_/ .___/____/\____/\/_/ /_/  /_/\___/_/|_/____/
     /_/

Przekierowanie HTTP na HTTPS w pliku hostingu Apache2

W pliku hostingu HTTP, dopisujemy poniższe opcje.

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Aby te opcje zadziałały, niezbędne jest włączenie modułu rewrite.

$ sudo a2enmod rewrite

Źródło: Internet.

~xf0r3m