From a2f5e858a704a0d8def633a7052f3a6a336ae0ee Mon Sep 17 00:00:00 2001 From: Chris Coleman Date: Mon, 19 Feb 2024 16:46:16 -0500 Subject: [PATCH] Fix #74 Can't login when SuiteCRM 8 is behind a LoadBalancer --- public/.htaccess | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/.htaccess b/public/.htaccess index 047e5682d7..fb4a05fd0b 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -20,6 +20,12 @@ DirectoryIndex index.php RewriteEngine On + # Fix #74 Redirect http to https (except when request comes from localhost). + # This is the security requirement for login. + RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1 + RewriteCond %{HTTPS} !=on + RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R=301,L] + RewriteRule ^index.php.*$ - [L,NC] # Determine the RewriteBase automatically and set it as environment variable.