Rediriger votre site en HTTPS sous Nginx/Apache

De Ikoula Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Introduction

Vous souhaitez que votre site "http://site.com/" soit automatiquement rediriger vers "https://site.com/".

Déroulé


Vous aurez à modifier le fichier ".htaccess" qui se trouve dans httpdocs.

Pour une redirection simple du trafic HTTP vers HTTPS il faut mettre ce code dans ce fichier:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]