-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess.example
77 lines (67 loc) · 2.35 KB
/
.htaccess.example
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
RewriteEngine On
# [HTTPS]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
# [/HTTPS]
# [WWW]
RewriteCond %{HTTP_HOST} ^the-scientist-oath\.com$ [NC]
RewriteRule (.*) https://www.the-scientist-oath.com/$1 [R=301,L]
# [/WWW]
# [PWA]
<Files /service-worker.js>
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</Files>
<Files /assets/js/service-worker.js>
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</Files>
# [/PWA]
# [COMPRESSION]
# Serve Brotli
RewriteCond %{HTTP:Accept-encoding} br
RewriteCond %{REQUEST_FILENAME}\.br -s
RewriteRule ^(.*)\.(html|css|js|json)$ $1.$2.br [QSA]
# Serve GZip
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.(html|css|js|json)$ $1.$2.gz [QSA]
# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule \.html\.gz$ - [T=text/html,E=no-gzip:1]
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
RewriteRule \.json\.gz$ - [T=application/json,E=no-gzip:1]
RewriteRule \.html\.br$ - [T=text/html,E=no-gzip:1]
RewriteRule \.css\.br$ - [T=text/css,E=no-gzip:1]
RewriteRule \.js\.br$ - [T=text/javascript,E=no-gzip:1]
RewriteRule \.json\.br$ - [T=application/json,E=no-gzip:1]
<FilesMatch "\.(js|css|json|html)\.gz$">
# Serve correct encoding type.
Header set Content-Encoding gzip
# Force proxies to cache gzipped & non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
<FilesMatch "\.(js|css|json|html)\.br$">
# Serve correct encoding type.
Header set Content-Encoding br
# Force proxies to cache gzipped & non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
# [/COMPRESSION]
# [CACHING]
ExpiresActive On
<FilesMatch "\.(ico|jpe?g|png|svg|css|html|js|json|vue|ttf)(\.gz|\.br)?$">
ExpiresDefault "access plus 1 month"
FileETag All
</FilesMatch>
# [/CACHING]