-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
71 lines (59 loc) · 2.14 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
# Enable RewriteEngine
RewriteEngine On
# Handle Authorization Header
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
# Set environment variables
SetEnv SQUARE_APPLICATION_ID sandbox-sq0idb-xeQzkR1UU5sS3aapMpPacQ
SetEnv SQUARE_ENVIRONMENT sandbox
SetEnv SQUARE_ACCESS_TOKEN EAAAl7t4u29Qkr1jCgqNwDqBFL-WHjbjz_sPXRpz5vjln7sfCQ12DnWZb6ZkCzGC
SetEnv SQUARE_LOCATION_ID LSVZHFQ2F7DBF
SetEnv SITE_URL https://crystalkeepsakes.com/
# Prevent .env file access
<Files .env>
Order allow,deny
Deny from all
</Files>
# Redirect www to non-www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# If the request is not for a valid file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for the API
RewriteCond %{REQUEST_URI} !^/api/
# Rewrite all requests to index.html
RewriteRule ^ index.html [L]
# Set correct MIME types
AddType application/javascript .js
AddType text/css .css
AddType application/json .json
AddType image/svg+xml .svg
AddType application/x-web-app-manifest+json .webmanifest
# Enable gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json
</IfModule>
# Force no caching during development
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
# Set caching headers
#<IfModule mod_expires.c>
# ExpiresActive On
# ExpiresByType text/html "access plus 0 seconds"
# ExpiresByType text/css "access plus 1 year"
# ExpiresByType application/javascript "access plus 1 year"
# ExpiresByType application/json "access plus 0 seconds"
# ExpiresByType image/jpeg "access plus 1 year"
# ExpiresByType image/png "access plus 1 year"
# ExpiresByType image/svg+xml "access plus 1 year"
#</IfModule>
# Set security headers
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "DENY"
Header set X-XSS-Protection "1; mode=block"
Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>