-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.htaccess.dist
87 lines (70 loc) · 2.21 KB
/
.htaccess.dist
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
##
## BasicAuth for development purposes
##
# AuthType Basic
# AuthName "Say my name!"
# AuthUserFile /ABSOLUTE/PATH/TO/.htpasswd
# Require valid-user
DirectoryIndex index.php
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
Options +SymLinksIfOwnerMatch
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset UTF-8
##
## Enable apache rewrite engine
##
RewriteEngine On
##
## You may need to uncomment the following line for some hosting environments,
## if you have installed to a subdirectory, enter the name here also.
##
# RewriteBase /
##
## Uncomment following lines to force HTTPS.
##
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{SERVER_NAME}/$1 [L,R=301]
##
## Black listed folders
##
RewriteRule ^bootstrap/.* index.php [L,NC]
RewriteRule ^classes/.* index.php [L,NC]
RewriteRule ^functions/* index.php [L,NC]
RewriteRule ^includes/* index.php [L,NC]
RewriteRule ^app/.* index.php [L,NC]
RewriteRule ^config/.* index.php [L,NC]
RewriteRule ^tests/.* index.php [L,NC]
##
## White listed folders
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !/.well-known/*
RewriteCond %{REQUEST_FILENAME} !/(uploads|storage|public)/.*
RewriteCond %{REQUEST_FILENAME} !/themes/.*/(assets|resources|public)/.*
RewriteRule !^index.php index.php [L,NC]
# restrict access to dot files
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule /\.|^\.(?!well-known/) - [F,L]
##
## Block all PHP files, except app index
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]
##
## Standard routes
##
# Deliver the folder or file directly if it exists on the server
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Push every request to index.php
RewriteRule ^(.*)$ /index.php [QSA]
</IfModule>