-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path.htaccess
68 lines (62 loc) · 2.42 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
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
###################################################
#Redirect to non-www
###################################################
# RewriteCond %{HTTP_HOST} ^www\.
# RewriteCond %{HTTPS}s ^on(s)|off
# RewriteCond http%1://%{HTTP_HOST} ^(https?://)(www\.)?(.+)$
# RewriteRule ^ %1%3%{REQUEST_URI} [R=301,L]
###################################################
#Redirect to https
###################################################
# RewriteCond %{HTTPS} !on
# RewriteCond %{HTTP:X-Forwarded-Proto} !=https
# RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,QSA,NE]
# Header set Content-Security-Policy "upgrade-insecure-requests;"
###################################################
#Set index folder
###################################################
RewriteRule ^$ /www/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/www/
RewriteRule ^(.*)$ /www/$1
</IfModule>
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 31536000 seconds"
ExpiresByType image/jpeg "access plus 31536000 seconds"
ExpiresByType image/jpg "access plus 31536000 seconds"
ExpiresByType image/png "access plus 31536000 seconds"
ExpiresByType image/gif "access plus 31536000 seconds"
ExpiresByType image/webp "access plus 31536000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 21600 seconds"
ExpiresByType text/javascript "access plus 21600 seconds"
ExpiresByType application/javascript "access plus 21600 seconds"
ExpiresByType application/x-javascript "access plus 21600 seconds"
ExpiresByType text/html "access plus 21600 seconds"
ExpiresByType application/xhtml+xml "access plus 21600 seconds"
</ifModule>
# END Expire headers
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
Header set Cache-Control "max-age=31536000, public"
<filesMatch "\.(ico|jpe?g|png|gif|swf|webp)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=21600, private"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=21600, private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, max-age=21600"
</filesMatch>
</ifModule>
# END Cache-Control Headers