forked from apache/echarts-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
62 lines (47 loc) · 2.01 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
AddDefaultCharset UTF-8
RedirectMatch 404 /\.git
RedirectMatch 404 /\.gitignore
RedirectMatch 404 /\.htaccess
RedirectMatch 404 /\.scripts
RedirectMatch 404 /\.github
RedirectMatch 404 /\.asf\.yaml
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin: https://echarts.apache.org
Header set Access-Control-Allow-Methods "*"
Header set Access-Control-Allow-Headers "*"
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType text/html "access plus 1 hour"
ExpiresByType image/png "access plus 1 hour"
ExpiresByType image/jpg "access plus 1 hour"
ExpiresByType image/jpeg "access plus 1 hour"
ExpiresByType text/css "access plus 1 hour"
ExpiresByType application/javascript "access plus 1 hour"
ExpiresByType application/json "access plus 1 hour"
ExpiresDefault "access plus 10 days"
</IfModule>
# no cahce for root index redirection
<If "%{REQUEST_URI} =~ m#^/?(((examples)|(handbook))/?)?([\w\-]+\.html)?$#">
<IfModule mod_expires.c>
ExpiresActive off
</IfModule>
<IfModule mod_headers.c>
Header always set Cache-Control "no-store, no-cache, must-revalidate"
Header always set Expires "Thu, 01 Dec 1994 16:00:00 GMT"
Header always merge Vary "Accept-Language"
</IfModule>
</If>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond "%{HTTP:Accept-Language}" ^zh [NC]
RewriteRule ^/?(index\.html)?$ "/zh/index.html" [L,R=302]
RewriteRule ^/?(index\.html)?$ "/en/index.html" [L,R=302]
# special redirection for examples & handbook
RewriteCond "%{HTTP:Accept-Language}" ^zh [NC]
RewriteRule ^/?((examples)|(handbook))/?([\w\-]+\.html)?$ "/$1/zh/$4" [L,R=302]
RewriteRule ^/?((examples)|(handbook))/?([\w\-]+\.html)?$ "/$1/en/$4" [L,R=302]
RewriteCond "%{HTTP:Accept-Language}" ^zh [NC]
RewriteRule ^/?([\w\-]+)\.html$ "/zh/$1.html" [L,R=302]
RewriteRule ^/?([\w\-]+)\.html$ "/en/$1.html" [L,R=302]
</IfModule>