-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
48 lines (39 loc) · 1.71 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
# Gatsby-Plugin-Htaccess
# This file is a reduced version of the Apache Server Configs v3.0.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# ----------------------------------------------------------------------
# | Enforce non-www domain |
# ----------------------------------------------------------------------
#RewriteEngine On
#RewriteCond %{HTTP_HOST} ^www.aperturepedia.com [NC]
#RewriteRule ^(.*) http://aperturepedia.com/$1 [L,R=301]
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)/$ /$1 [L,R] # <- for test, for prod use [L,R=302]
#RewriteEngine on
# Include trailing slash on directory
#RewriteCond %{REQUEST_URI} !(.+)/$
#RewriteCond %{REQUEST_FILENAME}
#RewriteRule ^(.+)$ https://aperturepedia.com/$1/ [R=302,L]
# Force HTTPS and WWW
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [OR,NC]
#RewriteCond %{https} off
#RewriteRule ^(.*)$ https://aperturepedia.com/$1 [R=302,L]
# ----------------------------------------------------------------------
# | Expires headers |
# ----------------------------------------------------------------------
# This matches the settings descriped at:
# https://www.gatsbyjs.org/docs/caching/
<IfModule mod_headers.c>
<FilesMatch "\.html$">
Header set Cache-Control "public, max-age=0, must-revalidate"
</FilesMatch>
<FilesMatch "\.(js|css)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
<FilesMatch "\.(json)$">
Header set Cache-Control "public, max-age=3153600, immutable"
</FilesMatch>
<Files sw.js>
Header set Cache-Control "public, max-age=0, must-revalidate"
</Files>
</IfModule>