From c4f48fab95bc1e2c8ef9ef969dd31cb5df140311 Mon Sep 17 00:00:00 2001 From: Florent Le Saout Date: Tue, 28 Jul 2020 23:04:51 +0200 Subject: [PATCH] Correct http to https redirection Signed-off-by: Florent Le Saout --- src/.htaccess | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/.htaccess b/src/.htaccess index 98c29a0..417af5a 100644 --- a/src/.htaccess +++ b/src/.htaccess @@ -1,4 +1,12 @@ -RewriteEngine On -RewriteCond %{SERVER_PORT} 80 -RewriteRule ^(.*)$ https://www.astrolabe.coop/$1 [R,L] +# Prevent viewing of htaccess file. + + order allow,deny + deny from all + +# Prevent directory listings +Options All -Indexes ErrorDocument 404 /404.html +RewriteEngine On +RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR] +RewriteCond %{HTTP_HOST} ^astrolabe\.coop [NC] +RewriteRule ^ https://www.astrolabe.coop%{REQUEST_URI} [L,NE,R=301]