-
Notifications
You must be signed in to change notification settings - Fork 5
/
rewrites.xml
316 lines (198 loc) · 11.4 KB
/
rewrites.xml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!-- URL rewrite -->
<rewrite>
<rewriteMaps>
<!-- old portal subtopic to new portal topic -->
<rewriteMap name="Subtopic-To-DE-Topic">
<add key="104" value="active-design" />
<add key="122" value="air-quality" />
<add key="95" value="alcohol-use" />
<add key="97" value="alcohol-use" />
<add key="11" value="asthma" />
<add key="92" value="bed-bugs" />
<add key="16" value="birth-defects" />
<add key="12" value="birth-outcomes" />
<add key="39" value="cancer" />
<add key="93" value="cancers-in-children" />
<add key="51" value="carbon-monoxide-incidents" />
<add key="15" value="carbon-monoxide-incidents" />
<add key="3" value="cigarette-smoke" />
<add key="1" value="air-quality" />
<add key="107" value="climate" />
<add key="8" value="cockroaches" />
<add key="52" value="drinking-water-quality" />
<add key="108" value="falls-among-older-adults" />
<add key="121" value="health-care" />
<add key="103" value="health-impacts-of-air-pollution" />
<add key="127" value="healthy-eating" />
<add key="36" value="housing-maintenance" />
<add key="7" value="mice-and-rats" />
<add key="126" value="mortality" />
<add key="91" value="air-quality" />
<add key="113" value="overweight" />
<add key="9" value="pesticides" />
<add key="96" value="physical-activity" />
<add key="106" value="social-conditions" />
<add key="98" value="restaurant-food-safety" />
<add key="109" value="social-conditions" />
<add key="101" value="transportation-related-injuries" />
<add key="116" value="vector-borne-disease" />
<add key="125" value="violence" />
<add key="119" value="walking,-driving,-and-cycling" />
<add key="100" value="weather-related-illness" />
<add key="115" value="worker-health" />
<!-- redirected to related topic above -->
<!-- <add key="95" value="alcohol-access" /> -->
<!-- <add key="15" value="carbon-monoxide-poisoning" /> -->
<!-- <add key="1" value="citywide-air-quality" /> -->
<!-- <add key="91" value="neighborhood-air-quality" /> -->
<!-- <add key="106" value="population-characteristics" /> -->
<!-- draft topic pages - no redirect for now -->
<!-- <add key="14" value="childhood-lead-exposure" /> -->
<!-- <add key="123" value="chronic-obstructive-pulmonary-disease" /> -->
<!-- <add key="94" value="solid-waste" /> -->
<!-- <add key="102" value="sugary-drink-consumption" /> -->
<!-- <add key="114" value="traffic" /> -->
<!-- <add key="117" value="vulnerability" /> -->
<!-- <add key="88" value="brownfields" /> -->
<!-- <add key="13" value="heart-attacks" /> -->
<!-- <add key="74" value="large-city-air-quality-comparison" /> -->
<!-- <add key="4" value="lead-hazards" /> -->
</rewriteMap>
<!-- old portal data explorer tab to new -->
<rewriteMap name="DE-Tab">
<add key="Summarize" value="summary" />
<add key="Map" value="map" />
<add key="ChartOverTime" value="trend" />
<add key="LinkData" value="links" />
</rewriteMap>
</rewriteMaps>
<rules>
<!-- redirect the user testing url -->
<rule name="User testing redirect" stopProcessing="true">
<match url="/?test/?" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<serverVariables>
<set name="HTTP_COOKIE" value="want_old_site=true" />
</serverVariables>
<action type="Redirect" url="." appendQueryString="false" redirectType="Temporary" />
</rule>
<!-- if the user has requested the old site, give them that -->
<rule name="no-redirect" stopProcessing="true">
<match url=".*" />
<conditions trackAllCaptures="true">
<add input="{HTTP_COOKIE}" pattern="want_old_site=true" />
</conditions>
<action type="None" />
</rule>
<!-- ## home page ## -->
<rule name="Home" stopProcessing="true">
<match url="(PublicTracking.aspx)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true">
<add input="{HTTP_COOKIE}" pattern="want_old_site=true" negate="true" />
<add input="{UNENCODED_URL}" pattern="/?test/?" negate="true" />
<add input="{UNENCODED_URL}" pattern="/?#$" negate="true" />
</conditions>
<action type="Redirect" url="beta/" appendQueryString="false" redirectType="Temporary" />
</rule>
<!-- ## hub pages ## -->
<!-- Heat Hub -->
<rule name="heat-hub-index" stopProcessing="true">
<match url="HeatHub/index.html" />
<action type="Redirect" url="beta/key-topics/climatehealth/" redirectType="Temporary" />
</rule>
<rule name="heat-hub-sub" stopProcessing="true">
<match url="HeatHub/(hvi|syndromic)\.(html)" />
<action type="Redirect" url="beta/key-topics/climatehealth/{R:1}/" redirectType="Temporary" />
</rule>
<!-- Air Quality Hub -->
<rule name="aq-hub-index" stopProcessing="true">
<match url="AQHub/index.html" />
<action type="Redirect" url="beta/key-topics/airquality/" redirectType="Temporary" />
</rule>
<rule name="aq-hub-aqe" stopProcessing="true">
<match url="AQHub/explorer.html" />
<action type="Redirect" url="beta/key-topics/airquality/aqe/" redirectType="Temporary" />
</rule>
<rule name="aq-hub-realtime" stopProcessing="true">
<match url="AQHub/realtime.html" />
<action type="Redirect" url="beta/key-topics/airquality/realtime/" redirectType="Temporary" />
</rule>
<!-- ## cold infographic ## -->
<rule name="cold-infographic" stopProcessing="true">
<match url="^cold/?$" />
<action type="Redirect" url="beta/data-stories/cold/" redirectType="Temporary" />
</rule>
<!-- ## data stories ## -->
<rule name="data-stories" stopProcessing="true">
<match url="Closerlook/([a-zA-Z]+)" />
<action type="Redirect" url="beta/data-stories/{R:1}/" redirectType="Temporary" />
</rule>
<!-- ## data explorer topics, using rewrite map ## -->
<rule name="data-explorer-topics" stopProcessing="true">
<match url="Subtopic.aspx" />
<conditions>
<add input="{QUERY_STRING}" pattern="subtopic_id=([0-9]+)" />
<add input="{Subtopic-To-DE-Topic:{C:1}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="beta/data-explorer/{C:1}/" appendQueryString="False" redirectType="Temporary" />
</rule>
<!-- ## Top-tier pages ## -->
<!-- data explorer landing page -->
<rule name="data-explorer" stopProcessing="true">
<match url="^Subtopic.aspx$" />
<action type="Redirect" url="beta/data-explorer/" appendQueryString="false" redirectType="Temporary" />
</rule>
<!-- learn more -->
<rule name="learn-more" stopProcessing="true">
<match url="^LearnMore.aspx$" />
<action type="Redirect" url="beta/" appendQueryString="false" redirectType="Temporary" />
</rule>
<!-- data story landing page -->
<rule name="data-story-landing" stopProcessing="true">
<match url="^Infographic.aspx$" />
<action type="Redirect" url="beta/data-stories/" appendQueryString="false" redirectType="Temporary" />
</rule>
<!-- full neighborhood reports path -->
<rule name="neighborhood-reports" stopProcessing="true">
<match url="^neighborhood_reports/(.*)" />
<action type="Redirect" url="beta/neighborhood-reports/{R:1}" appendQueryString="false" redirectType="Temporary" />
</rule>
<!-- ## data explorer tabs, using rewrite map ## -->
<rule name="data-explorer-tabs" stopProcessing="true">
<match url="VisualizationData.aspx" />
<conditions trackAllCaptures="true">
<!--pattern => C:1 = internal_id/IndicatorID, C:2 = subtopic_id, C:3 = tab name -->
<add input="{QUERY_STRING}" pattern="id=([0-9]+),\w*,(\d*),([a-zA-Z]+)" />
<add input="{Subtopic-To-DE-Topic:{C:2}}" pattern="(.+)" /> <!-- pattern => C:4 = topic name -->
<add input="{DE-Tab:{C:3}}" pattern="(.+)" /> <!-- pattern => C:5 = new tab name -->
</conditions>
<action type="Redirect" url="beta/data-explorer/{C:4}/?id={C:1}#display={C:5}" appendQueryString="False" redirectType="Temporary" />
</rule>
</rules>
<outboundRules>
<!-- set cookie with original URL -->
<rule name="set-url-cookie">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
<conditions>
<add input="{UNENCODED_URL}" pattern="/beta" negate="true" />
<add input="{HTTP_COOKIE}" pattern="want_old_site=true" negate="true" />
</conditions>
<action type="Rewrite" value="original_url={UNENCODED_URL}; {R:0}" />
</rule>
<!-- set cookie with want old site -->
<rule name="want-old-site-true" stopProcessing="true">
<match filterByTags="None" serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
<conditions>
<add input="{UNENCODED_URL}" pattern="/?beta/?" negate="true" />
</conditions>
<action type="Rewrite" value="want_old_site=true" replace="true" />
</rule>
<rule name="want-old-site-false">
<match serverVariable="RESPONSE_Set_Cookie" pattern=".*" />
<conditions>
<add input="{UNENCODED_URL}" pattern="/?beta/?" />
</conditions>
<action type="Rewrite" value="want_old_site=false" />
</rule>
</outboundRules>
</rewrite>