-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.htaccess
74 lines (57 loc) · 1.89 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
# Ignore access to specific file extensions
<FilesMatch "\.(env|gitignore|gitattributes|gitmodules|sqlite|git|htaccess|conf|sql|db|sqlite-whm|out|ts)$">
Order allow,deny
Deny from all
</FilesMatch>
# Allow access to robots.txt and sitemap.txt
RewriteRule ^(robots|sitemap)\.txt$ - [L]
# Block access to all other text files by default
RewriteRule \.txt$ - [F]
# Deny access to the 'packages' directory
RewriteRule ^packages/ - [F,L]
# Deny access to the 'dist' directory
RewriteRule ^dist/ - [F,L]
# Deny access to the 'node_backend' directory
RewriteRule ^node_backend/ - [F,L]
# Deny access to the 'python_browser' directory
RewriteRule ^node_browser/ - [F,L]
# Deny access to the 'python_browser' directory
RewriteRule ^python_browser/ - [F,L]
# Set cache-control for 5 mins for working.json and status.json
<FilesMatch "^(working|status)\.json$">
Header set Cache-Control "public, max-age=300"
</FilesMatch>
# Disallow access to working.json
<Files "working.json">
Require all denied
</Files>
# Skip caching on .html files
<FilesMatch "\.html$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "0"
</FilesMatch>
</IfModule>
# Allow access to sitemap.txt explicitly
<Files "sitemap.txt">
Allow from all
</Files>
# Temporary directory restrictions
<If "%{HTTP_HOST} == 'sh.webmanajemen.com'">
Redirect 404 /tmp
</If>
# Tests directory restrictions
<If "%{HTTP_HOST} == 'sh.webmanajemen.com'">
Redirect 404 /tests
</If>
# Backups directory restrictions
<If "%{HTTP_HOST} == 'sh.webmanajemen.com'">
Redirect 404 /backups
</If>
# Block access to github files
<FilesMatch "^\.git">
Require all denied
</FilesMatch>