-
-
Notifications
You must be signed in to change notification settings - Fork 419
Expand file tree
/
Copy path.htaccess
More file actions
62 lines (50 loc) · 1.38 KB
/
Copy path.htaccess
File metadata and controls
62 lines (50 loc) · 1.38 KB
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
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# 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]
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteRule \.php$ - [F,L]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
# Restrict access to critical files
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
<Files ~ "\.sqlite$">
Order allow,deny
Deny from all
</Files>
<Files ~ "\.zip$">
Order allow,deny
Deny from all
</Files>
<Files ~ "\.log$">
Order allow,deny
Deny from all
</Files>
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Block access to .env files
RewriteRule ^.*\.env$ - [F,L]
# Block access to SQLite database files
RewriteRule ^.*\.sqlite$ - [F,L]
# Block access to ZIP files
RewriteRule ^.*\.zip$ - [F,L]
# Block access to LOG files
RewriteRule ^.*\.log$ - [F,L]
</IfModule>