-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
46 lines (37 loc) · 1.21 KB
/
Copy path.htaccess
File metadata and controls
46 lines (37 loc) · 1.21 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
# Pet Gallery - Apache Configuration
# Enable Rewrite Engine
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
</IfModule>
# Prevent directory browsing
Options -Indexes
# Set default charset
AddDefaultCharset UTF-8
# Enable Gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript
</IfModule>
# Cache static assets
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
</IfModule>
# Security headers
<IfModule mod_headers.c>
# Prevent clickjacking
Header always set X-Frame-Options "SAMEORIGIN"
# XSS protection
Header always set X-XSS-Protection "1; mode=block"
# Prevent MIME type sniffing
Header always set X-Content-Type-Options "nosniff"
</IfModule>
# Custom error pages (optional)
# ErrorDocument 404 /404.html
# ErrorDocument 500 /500.html