-
Notifications
You must be signed in to change notification settings - Fork 208
Expand file tree
/
Copy path.htaccess
More file actions
43 lines (34 loc) · 1.27 KB
/
.htaccess
File metadata and controls
43 lines (34 loc) · 1.27 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
# ----------------------------------------------------
# Rewrite rules (only if mod_rewrite is enabled)
# ----------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^$ index.php [L]
# Force HTTPS (uncomment to enable)
# RewriteCond %{HTTPS} !=on
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# ----------------------------------------------------
# Security Rules
# ----------------------------------------------------
# Block hidden files (starting with .)
<FilesMatch "^\.">
Require all denied
</FilesMatch>
# Block sensitive project files
<FilesMatch "\.(env|ini|log|conf|json|lock|yml|yaml|md|txt|sh|bat|ps1|xml|bak|sql|dist|inc|cfg|db|csv)$">
Require all denied
</FilesMatch>
# Allow specific exceptions
<FilesMatch "^(server_accounts_sample\.yaml|server_accounts_sample\.csv|contact_sample\.csv)$">
Require all granted
</FilesMatch>
# Block certain project/config files
<FilesMatch "(RELEASE_NOTES|Makefile|Dockerfile|docker-compose\.yml|docker-compose\.dev\.yaml|docker-compose\.prod\.yaml)">
Require all denied
</FilesMatch>
# Prevent access to .git directory
RedirectMatch 403 /(?:\.git)/.*$
# Disable directory listing
Options -Indexes