Fix a bug of redirecting https to http (#208)

This commit is contained in:
lookas 2020-07-23 10:57:41 +08:00 committed by GitHub
parent db57a56e25
commit 36ad2cf781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,12 @@
RewriteRule (^\.|/\.) - [F]
RewriteRule ^storage/.* - [F]
# Redirect trailing slashes if not a folder (behind a reverse proxy)
RewriteCond %{HTTP:X-Forwarded-Proto} ^https$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ "%{HTTP:X-Forwarded-Proto}://%{HTTP_HOST}%1" [L,R=301]
# Redirect trailing slashes if not a folder
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$