-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: redirect trafic to https (#965)
- Loading branch information
Showing
2 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<IfModule mod_rewrite.c> | ||
<IfModule mod_negotiation.c> | ||
Options -MultiViews -Indexes | ||
</IfModule> | ||
|
||
RewriteEngine On | ||
|
||
# Redirect to https | ||
RewriteCond %{HTTP:X-Forwarded-Proto} !=https | ||
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,N] | ||
|
||
<IfModule mod_headers.c> | ||
# Activate HSTS | ||
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;" | ||
|
||
Header always set Referrer-Policy "no-referrer" | ||
Header always set X-Content-Type-Options "nosniff" | ||
Header always set X-Download-Options "noopen" | ||
Header always set X-Frame-Options "SAMEORIGIN" | ||
Header always set X-Permitted-Cross-Domain-Policies "none" | ||
Header always set X-Robots-Tag "none" | ||
Header always set X-XSS-Protection "1; mode=block" | ||
|
||
# Assets expire after 1 month | ||
<filesMatch ".(css|js|woff2?|json)$"> | ||
Header set Cache-Control "public, max-age=2628000" | ||
</filesMatch> | ||
|
||
# Images expire after 6 months | ||
<filesMatch ".(svg|png|gif|ico|jpe?g)$"> | ||
Header set Cache-Control "public, max-age=15768000" | ||
</filesMatch> | ||
</IfModule> | ||
|
||
# Handle Authorization Header | ||
RewriteCond %{HTTP:Authorization} . | ||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | ||
|
||
# Redirect Trailing Slashes If Not A Folder... | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteCond %{REQUEST_URI} (.+)/$ | ||
RewriteRule ^ %1 [L,R=301] | ||
|
||
# Handle Front Controller... | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteRule ^ index.php [L] | ||
</IfModule> |