/
.htaccess
112 lines (87 loc) · 3.3 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
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
109
110
111
112
<IfModule mod_rewrite.c>
# (1)
RewriteEngine On
# (2)
Options +FollowSymlinks
# (3)
# Options +SymLinksIfOwnerMatch
# (4)
# RewriteBase /
#RewriteBase /
# (5)
# RewriteOptions <options>
# (6)
RewriteCond %{HTTPS} =on
RewriteRule ^ - [env=proto:https]
RewriteCond %{HTTPS} !=on
RewriteRule ^ - [env=proto:http]
RewriteCond %{REQUEST_URI} !^(/index\.php|/img|/js|/css|/robots\.txt|/favicon\.ico)
#RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
#RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# If an existing asset or directory is requested go to it as it is
#RewriteRule ^ - [L]
RewriteRule . /index.html [L]
# If the requested resource doesn't exist, use index.html
#RewriteRule . /index.php [QSA,L]
Options -Indexes
ErrorDocument 404 http://www.domain.com/your-custom-404.php
ErrorDocument 403 http://www.domain.com/your-custom-404.php
</IfModule>
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# If you don't use filenames to version, lower the CSS and JS to something like
# "access plus 1 week".
<IfModule mod_expires.c>
ExpiresActive on
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Your document html
ExpiresByType text/html "access plus 0 seconds"
# Media: images, video, audio
ExpiresByType audio/ogg "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType video/mp4 "access plus 1 week"
ExpiresByType video/ogg "access plus 1 week"
ExpiresByType video/webm "access plus 1 week"
ExpiresByType video/webm "access plus 1 week"
# CSS and JavaScript
ExpiresByType application/javascript "access plus 4 hours"
ExpiresByType text/css "access plus 4 hours"
# # Compress compressible fonts
# AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml
#
# # Add a far future Expires header for fonts
ExpiresByType application/vnd.ms-fontobject "access plus 1 week"
ExpiresByType font/ttf "access plus 1 week"
ExpiresByType font/otf "access plus 1 week"
ExpiresByType font/x-woff "access plus 1 week"
ExpiresByType image/svg+xml "access plus 1 week"
</IfModule>
<IfModule mod_headers.c>
Header append Cache-Control "public, no-transform"
</IfModule>
#RewriteEngine On
#
## Some hosts may require you to use the `RewriteBase` directive.
## If you need to use the `RewriteBase` directive, it should be the
## absolute physical path to the directory that contains this htaccess file.
##
#RewriteBase /
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^ index.html [QSA,L]
#
#Options -Indexes