From a499550b219a7bea266045023c5f8822302546c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Thu, 9 Feb 2023 15:43:37 +0100
Subject: [PATCH] fix: HTTP not redirected to HTTPS

refs #587
---
 src/.htaccess | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/.htaccess b/src/.htaccess
index 34b87a8bc..6a66c8cec 100644
--- a/src/.htaccess
+++ b/src/.htaccess
@@ -1,3 +1,14 @@
+<IfModule mod_rewrite.c>
+	# SSL Redirect
+
+	# enable Rewrite capabilities
+	RewriteEngine On
+	# check the connection is not already HTTPS
+	RewriteCond %{HTTPS} off
+	# rewrite URL with https
+	RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
+</IfModule>
+
 <filesMatch "\.json$">
 	FileETag None
 	<ifModule mod_headers.c>
-- 
GitLab