-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
58 lines (54 loc) · 2.08 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
# INSTRUCTION:
# There are two options for the redirection:
# Option 1) (default): Your app is directly on the root of the domain.
# Option 2): Your app is placed in a subfolder from the root of the domain.
#
# If you have issues with browser caching you can uncomment the BROWSER CACHING part
# For new versions of this Gist go to:
# https://gist.github.com/julianpoemp/bcf277cb56d2420cc53ec630a04a3566
#------------ REDIRECTION option 1)
# use this if your app directly on the root of the domain,
# e.g. http://example_domain.com/index.html
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) index.html [NC,L]
</IfModule>
#------------
#------------ REDIRECTION option 2)
# Use this if your app is not directly on the root of the domain,
# e.g. http://example_domain.com/directory_path/index.html
# Important: replace directory_path with the relative path from
# the domain to the index.html. Keep the first "/". Don't forget to comment option 1).
#<IfModule mod_rewrite.c>
# RewriteEngine on
# RewriteCond %{REQUEST_FILENAME} -s [OR]
# RewriteCond %{REQUEST_FILENAME} -l [OR]
# RewriteCond %{REQUEST_FILENAME} -d
# RewriteRule ^.*$ - [NC,L]
# RewriteRule ^(.*) /directory_path/index.html [NC,L]
#</IfModule>
#------------
# #------------ BROWSER CACHING
# disable browser caching in production.
#<FilesMatch "\.(html|htm|js|json|css)$">
# <IfModule mod_headers.c>
# FileETag None
# Header unset ETag
# Header unset Pragma
# Header unset Cache-Control
# Header unset Last-Modified
# Header set Pragma "no-cache"
# Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
# Header set Expires "Mon, 10 Apr 1972 00:00:00 GMT"
# </IfModule>
#</FilesMatch>
#
# It is recommended to add these tags to your index.html, too:
# <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
# <meta http-equiv="Pragma" content="no-cache">
# <meta http-equiv="Expires" content="0">
#------------