Added redirects

This commit is contained in:
Sebastian Lay 2023-07-09 17:51:33 +02:00
parent 83c8e5bd57
commit 81e40a14d7
No known key found for this signature in database
GPG Key ID: A699D9B80D6068AA

View File

@ -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]