forked from stride3d/stride-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web.config
81 lines (81 loc) · 4.15 KB
/
web.config
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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
<security>
<requestFiltering allowDoubleEscaping="true" />
</security>
<staticContent>
<clientCache cacheControlMaxAge="1.00:00:00" cacheControlMode="UseMaxAge" />
<remove fileExtension=".html" />
<remove fileExtension=".json" />
<remove fileExtension=".css" />
<remove fileExtension=".webp" />
<remove fileExtension="woff" />
<remove fileExtension="woff2" />
<remove fileExtension=".mp4" />
<remove fileExtension=".md" />
<remove fileExtension=".yml" />
<mimeMap fileExtension=".html" mimeType="text/html" />
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".css" mimeType="text/css" />
<mimeMap fileExtension=".webp" mimeType="image/webp" />
<mimeMap fileExtension="woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension="woff2" mimeType="application/font-woff2" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".md" mimeType="text/plain" />
<mimeMap fileExtension=".yml" mimeType="text/yaml" />
</staticContent>
<rewrite>
<rules>
<rule name="Redirect xenko.com to stride3d.net" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(.*)xenko\.com$" />
</conditions>
<action type="Redirect" url="https://{C:1}stride3d.net/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect root and 'latest' to 'latest/en/' ">
<match url="^(latest)?$" />
<action type="Redirect" url="latest/en/" redirectType="Found" />
</rule>
<rule name="Redirect 'latest/{1}' to 'latest/en/{1}' when language is missing from initial url">
<match url="^latest/(.*)" />
<conditions>
<add input="{R:1}" pattern="^(en|jp)(/|$)" negate="true" />
</conditions>
<action type="Redirect" url="latest/en/{R:1}" redirectType="Found"/>
</rule>
<rule name="Redirect missing language to /en/" stopProcessing="true">
<match url="^(\d+\.\d+)/?(.*)$" />
<conditions>
<add input="{R:2}" pattern="^(en|jp)(/|$)" negate="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="{R:1}/en/{R:2}" />
</rule>
<!-- Rename Xenko to Stride for 4.0+ and latest -->
<rule name="Redirect uppercase Xenko to Stride for 4.0+">
<match url="(([4-9]|[1-9]\d+)\.\d*|latest)/(.*)(Xenko)(.*)" />
<action type="Redirect" redirectType="Permanent" url="{R:1}/{R:3}Stride{R:5}" />
</rule>
<rule name="Redirect lowercase xenko to stride for 4.0+">
<match url="(([4-9]|[1-9]\d+)\.\d*|latest)/(.*)(xenko)(.*)" />
<action type="Redirect" redirectType="Permanent" url="{R:1}/{R:3}stride{R:5}" />
</rule>
<!-- Update this rule when there is a new Stride doc version released -->
<rule name="Rewrite URL for latest documentation">
<match url="latest(.*)" />
<action type="Rewrite" url="%deployment_version%/{R:1}" />
</rule>
</rules>
</rewrite>
<httpErrors errorMode="Custom">
<remove statusCode="404"/>
<error statusCode="404" path="%deployment_version%\en\404.html" responseMode="File" />
</httpErrors>
</system.webServer>
</configuration>