Repository navigation
Expand file tree
/
Copy pathweb.config
More file actions
138 lines (138 loc) · 8.76 KB
/
Copy pathweb.config
File metadata and controls
138 lines (138 loc) · 8.76 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?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>
<!-- Short: a deploy replaces the files under the same URLs, and a purge of Azure Front Door doesn't reach the browsers -->
<clientCache cacheControlMaxAge="01: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>
<!-- Contributing, community resources and release notes aren't versioned: they're built from master into /en/
(the unversioned list of versions.json, see BuildSiteRoot.ps1), and redirected there from any version.
?v= is the version the reader comes from, the links to the versioned docs keep it (see main.js). -->
<!-- The release notes of a version: its page (link of the navbar of every version) -->
<rule name="Redirect release notes page of a version" stopProcessing="true">
<match url="^(\d+\.\d+)/(?:(?:en|jp)/)?release-?notes(?:/(?:ReleaseNotes\.html|index\.html)?)?$" />
<action type="Redirect" redirectType="Found" url="en/release-notes/{R:1}.html?v={R:1}" />
</rule>
<rule name="Redirect release notes page of latest" stopProcessing="true">
<match url="^latest/(?:(?:en|jp)/)?release-?notes(?:/(?:ReleaseNotes\.html|index\.html)?)?$" />
<action type="Redirect" redirectType="Found" url="en/release-notes/%latest_version%.html" />
</rule>
<!-- The release notes of a version: its markdown, loaded by the Stride Launcher 5.x and older (which resolves their images from {version}/ReleaseNotes/,
redirected by the rules below). Newer launchers load /en/release-notes/{version}.md directly. -->
<!-- Obsolete when: no Stride Launcher 5.x or older is used anymore (no more requests to {version}/ReleaseNotes/ReleaseNotes.md in the logs, see Request Logs in deployment-azure.md) -->
<rule name="Redirect release notes markdown of a version" stopProcessing="true">
<match url="^(\d+\.\d+)/(?:(?:en|jp)/)?ReleaseNotes/ReleaseNotes\.md$" />
<action type="Redirect" redirectType="Found" url="en/release-notes/{R:1}.md" />
</rule>
<!-- The release notes folder of the docs of 4.3 and older: ReleaseNotes/, with ReleaseNotes-{version} pages -->
<rule name="Redirect old release notes folder of a version" stopProcessing="true">
<match url="^(\d+\.\d+)/(?:(?:en|jp)/)?ReleaseNotes/(?:ReleaseNotes-(\d+\.\d+)(\.\w+)|(.*))$" />
<action type="Redirect" redirectType="Found" url="en/release-notes/{R:2}{R:3}{R:4}?v={R:1}" />
</rule>
<rule name="Redirect old release notes folder of latest" stopProcessing="true">
<match url="^latest/(?:(?:en|jp)/)?ReleaseNotes/(?:ReleaseNotes-(\d+\.\d+)(\.\w+)|(.*))$" />
<action type="Redirect" redirectType="Found" url="en/release-notes/{R:1}{R:2}{R:3}" />
</rule>
<rule name="Redirect unversioned sections" stopProcessing="true">
<match url="^(\d+\.\d+)/(?:(?:en|jp)/)?(%unversioned_sections%)(/.*)?$" />
<action type="Redirect" redirectType="Found" url="en/{R:2}{R:3}?v={R:1}" />
</rule>
<rule name="Redirect unversioned sections of latest" stopProcessing="true">
<match url="^latest/(?:(?:en|jp)/)?(%unversioned_sections%)(/.*)?$" />
<action type="Redirect" redirectType="Found" url="en/{R:1}{R:2}" />
</rule>
<!-- Anything else under /en/ is versioned (i.e. links of the search index shared by both areas): latest has it -->
<rule name="Redirect versioned paths of the unversioned area to latest" stopProcessing="true">
<match url="^en/(.*)$" />
<conditions>
<add input="{R:1}" pattern="^(%unversioned_sections%)(/|$)" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="latest/en/{R:1}" />
</rule>
<rule name="Redirect missing language to /en/" stopProcessing="true">
<match url="^(\d+\.\d+)/?(.*)$" />
<conditions>
<add input="{R:2}" pattern="^(en|jp)(/|$)" negate="true" />
<!-- Files of the version folder itself -->
<add input="{R:2}" pattern="^build\.json$" 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>
<!-- %latest_version% is replaced by the latest version of versions.json (see BuildSiteRoot.ps1) -->
<rule name="Rewrite URL for latest documentation">
<match url="latest(.*)" />
<action type="Rewrite" url="%latest_version%/{R:1}" />
</rule>
</rules>
</rewrite>
<httpErrors errorMode="Custom">
<remove statusCode="404"/>
<error statusCode="404" path="%latest_version%\en\404.html" responseMode="File" />
</httpErrors>
</system.webServer>
<!-- 404 page of the unversioned area (its own build, see BuildDocs.ps1) -->
<location path="en">
<system.webServer>
<httpErrors errorMode="Custom">
<remove statusCode="404"/>
<error statusCode="404" path="en\404.html" responseMode="File" />
</httpErrors>
</system.webServer>
</location>
</configuration>