From d0a59cd6b69273582683d72fda0d5a7265697af3 Mon Sep 17 00:00:00 2001 From: edsea Date: Thu, 26 Dec 2024 01:25:09 +0100 Subject: [PATCH] Update htaccess --- .htaccess | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 1920cfd..79bfb37 100644 --- a/.htaccess +++ b/.htaccess @@ -1,7 +1,13 @@ RewriteEngine On +# Force HTTPS (redirect HTTP to HTTPS) RewriteCond %{HTTPS} off -RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] +RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] + +# Redirect www to non-www (if you want to remove www) +RewriteCond %{HTTP_HOST} ^www\.(example\.com)$ [NC] +RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301] + RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/index\.php[\s?/] [NC]