-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
50 lines (43 loc) · 1.49 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
# STRONG HTACCESS PROTECTION - make sure nothing can reach your htaccess via bot or browser
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
Deny from all
</Files>
Options All -Indexes
RewriteEngine On
RewriteBase /swcrepair/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.html
#FILE HEADERS SO THE BROWSER KNOWS HOW LONG TO KEEP A FILE TYPE CACHED
<IfModule mod_headers.c>
# 1 YEAR
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>
# 1 WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf|svg)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
# 3 HOUR
<FilesMatch "\.(txt|xml|js|css|php)$">
Header set Cache-Control "max-age=10800"
</FilesMatch>
<FilesMatch "\.(js|css|xml|gz|svg)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
# FILE EXPIRE SPECIFIC HEADER TO AGAIN HELP WITH PROPER CACHING
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 30 days"
ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType image/gif "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 7 days"
</IfModule>