You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/frontdoor/rules-engine-scenarios.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,11 +84,11 @@ Managing redirects is critical for search engine optimization (SEO), user experi
84
84
85
85
This approach eliminates the need to create a separate rule for each tenant ID, allowing you to handle dynamic routing with fewer rules.
86
86
87
-
# [**Portal**](#tab/portal)
87
+
# [**Portal**](#tab/portal)
88
88
89
89
:::image type="content" source="./media/rules-engine-scenarios/redirect-url-path-segment.png" alt-text="Screenshot that shows how to use fixed-length path segment to redirect URL." lightbox="./media/rules-engine-scenarios/redirect-url-path-segment.png":::
90
90
91
-
# [**ARM**](#tab/arm)
91
+
# [**ARM**](#tab/arm)
92
92
93
93
```json
94
94
{
@@ -119,19 +119,19 @@ Managing redirects is critical for search engine optimization (SEO), user experi
119
119
}
120
120
```
121
121
122
-
---
122
+
---
123
123
124
124
- **Redirect based on dynamic-length URL path segments:** When the URL path segment has a dynamic length, you can extract it using the `{url_path:seg#}`. For more information, see [Server variable format](/azure/frontdoor/rule-set-server-variables#server-variable-format).
125
125
126
126
For example, if a tenant ID or location is embedded in the URL segment, such as: `https://api.contoso.com/{tenantId}/xyz`, you can extract `{tenantId}` from the URL and decide the correct redirect in the format of `tenantId.backend.com/xyz` with server variable `{url_path:seg0}.backend.com` in the redirect destination host.
127
127
128
128
This method avoids creating separate rules for each tenant ID, enabling more efficient configuration.
129
129
130
-
# [**Portal**](#tab/portal)
130
+
# [**Portal**](#tab/portal)
131
131
132
-
N/A
132
+
N/A
133
133
134
-
# [**ARM**](#tab/arm)
134
+
# [**ARM**](#tab/arm)
135
135
136
136
```json
137
137
{
@@ -162,17 +162,17 @@ N/A
162
162
}
163
163
```
164
164
165
-
---
165
+
---
166
166
167
167
- **Redirect based on part of the incoming hostname:** You can redirect requests to different origins by extracting part of the incoming hostname.
168
168
169
169
For example, you can capture `tenantName` from `https://[tenantName].poc.contoso.com/GB` to redirect the request to `s1.example.com/Buyer/Main?realm=[tenantName]&examplename=example1` using the offset and length in server variable in the format of `{hostname:0:-16}`. For more information, see [Server variable format](/azure/frontdoor/rule-set-server-variables#server-variable-format).
170
170
171
-
# [**Portal**](#tab/portal)
171
+
# [**Portal**](#tab/portal)
172
172
173
173
:::image type="content" source="./media/rules-engine-scenarios/redirect-incoming-hostname.png" alt-text="Screenshot that shows how to use incoming hostname to redirect URL." lightbox="./media/rules-engine-scenarios/redirect-incoming-hostname.png":::
174
174
175
-
# [**ARM**](#tab/arm)
175
+
# [**ARM**](#tab/arm)
176
176
177
177
```json
178
178
{
@@ -217,7 +217,7 @@ N/A
217
217
}
218
218
```
219
219
220
-
---
220
+
---
221
221
222
222
## Scenario 2: Populate or modify a response header based on a request header value
0 commit comments