-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
108 lines (88 loc) · 3.15 KB
/
Copy path.htaccess
File metadata and controls
108 lines (88 loc) · 3.15 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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# ============================================
# SmartSense Home - Apache Configuration
# ============================================
# Place this file in the root directory or
# use the configurations as needed
# ============================================
# Enable RewriteEngine
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
# ============================================
# Security Headers
# ============================================
# Prevent directory listing
Options -Indexes
# Disable server signature
ServerSignature Off
# Protect against XSS
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
# ============================================
# PHP Settings
# ============================================
<IfModule mod_php.c>
php_flag display_errors Off
php_flag log_errors On
php_value max_execution_time 300
php_value upload_max_filesize 10M
php_value post_max_size 10M
</IfModule>
# ============================================
# CORS Settings (if needed)
# ============================================
# Uncomment if frontend is on different domain
# <IfModule mod_headers.c>
# Header set Access-Control-Allow-Origin "*"
# Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
# Header set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With, Device-Token"
# </IfModule>
# ============================================
# Compression
# ============================================
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>
# ============================================
# Caching
# ============================================
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
</IfModule>
# ============================================
# Error Pages
# ============================================
# Custom error pages (create these files if needed)
# ErrorDocument 404 /error404.html
# ErrorDocument 500 /error500.html
# ============================================
# Force HTTPS (Production only)
# ============================================
# Uncomment for production with SSL
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# </IfModule>
# ============================================
# Protect Sensitive Files
# ============================================
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
<FilesMatch "\.(log|sql|ini|conf)$">
Order allow,deny
Deny from all
</FilesMatch>