From 81e40a14d7b99279d6ca02dce33c3c616da7d1dd Mon Sep 17 00:00:00 2001 From: Sebastian Lay Date: Sun, 9 Jul 2023 17:51:33 +0200 Subject: [PATCH] Added redirects --- .htaccess | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.htaccess b/.htaccess index 5f23d37..b69a772 100644 --- a/.htaccess +++ b/.htaccess @@ -1,4 +1,12 @@ RewriteEngine On + +# non-https to https and www to non-www redirect +RewriteCond %{HTTPS} off [OR] +RewriteCond %{HTTP_HOST} ^www\. [NC] +RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] +RewriteRule ^ https://%1%{REQUEST_URI} [NE,R=301] + +# pretty URLs RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^\.]+)$ $1.html [NC,L]