-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
54 lines (42 loc) · 1.65 KB
/
.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<IfModule mod_rewrite.c>
# Don't use SymLinksIfOwnerMatch on windows
Options +SymLinksIfOwnerMatch
#Options +FollowSymLinks
RewriteEngine On
# FIX: php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default
RewriteCond %{HTTP:Authorization} ^(.+)$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Allow .well-known directory for use by Let's Encrypt.
RewriteRule ^\.well-known - [L]
# Deny access to:
# - the private folder,
# - any path starting with a dot,
# - .json,.lock and .log files on the root folder,
# - .php files other than index.php on the root folder.
# - anything from the bin folder.
RewriteRule ^(private/|\.|\w+\.(json|lock|log)) - [F,L,NC]
RewriteRule ^(?!index)[^./]+\.php - [F,L,NC]
RewriteRule ^bin/ - [F,L,NC]
# Serve existing files files.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
# Deny all other existing files.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [F,L,NC]
# Split the REQUEST_URI into a BASE_URI and a PATH.
RewriteRule ^(.*) - [E=PATH:/$1]
RewriteCond %{REQUEST_URI}%{ENV:PATH} ^(.*?)(.+)\2$
RewriteRule ^ - [E=BASE_URI:%1]
# Restore the suppressed Authorization header on FastCGI servers.
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
# Call the front-controller.
RewriteRule ^ %{ENV:BASE_URI}/index.php [L]
</IfModule>
# Disable multiviews to prevent interference with virtual routing.
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
# Compress some file types.
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/json text/javascript application/javascript
</IfModule>