-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
40 lines (31 loc) · 977 Bytes
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Allow access
Order Allow,Deny
Allow from all
# Set options
<IfModule mod_negotiation.c>
Options -Indexes -MultiViews +FollowSymLinks
</IfModule>
# URL rewriting
<IfModule mod_rewrite.c>
# Rewrite URLs
RewriteEngine On
# Set Request scheme header
RewriteCond %{HTTPS}s ^(on(s)|offs)$
RewriteRule ^ - [e=REQUEST_SCHEME:http%2]
# Set Authorization header
RewriteRule .* - [e=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Force no www
RewriteCond %{HTTP_HOST} ^(www\.)(.*)
RewriteCond %{HTTP_HOST} !localhost
RewriteRule .* %{ENV:REQUEST_SCHEME}://%2%{REQUEST_URI} [R=301,L]
# Force SSL?
<ifModule mod_ssl.c>
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# Route through index.php
# Deny direct file access to non-assets
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !(/index.php$)|(/manifest.json$)|(/sw.js$)|(/assets/)
RewriteRule (.*) index.php/$1 [L]
</IfModule>