Skip to content

Commit

Permalink
refactor: force https on sites other than localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
im-machakata committed Mar 27, 2024
1 parent 795adbc commit fb14ad1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ /public/$1 [L,QSA]

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^localhost$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REMOTE_ADDR} !^(127\.0\.0\.1|::1)$ [OR]
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

0 comments on commit fb14ad1

Please sign in to comment.