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: src/content/docs/rules/reference/page-rules-migration.mdx
+39-30Lines changed: 39 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,23 +137,21 @@ You configured a Page Rule to perform an automatic redirect from HTTP to HTTPS f
137
137
138
138
**How to migrate**:
139
139
140
-
1.[Create a single redirect](/rules/url-forwarding/single-redirects/create-dashboard/) to always redirect HTTP requests to HTTPS for any hostname that contains `example.com`:
140
+
1.[Create a single redirect](/rules/url-forwarding/single-redirects/create-dashboard/) to always redirect HTTP requests to HTTPS. You can select the **Redirect from HTTP to HTTPS** rule template or enter the following rule configuration:
2. Turn off your existing Page Rule and validate the behavior of the redirect you created.
159
157
@@ -896,28 +894,34 @@ You configured a Page Rule permanently redirecting `www.example.com` to `example
896
894
897
895
**How to migrate**:
898
896
899
-
1.[Create a single redirect](/rules/url-forwarding/single-redirects/create-dashboard/) to permanently redirect requests from `www.example.com` to `example.com`:
897
+
1.[Create a single redirect](/rules/url-forwarding/single-redirects/create-dashboard/) to permanently redirect requests from `https://www.example.com` to `https://example.com`. You can select the **Redirect from WWW to Root** rule template or enter the following rule configuration:
2. Turn off your existing Page Rule and validate the behavior of the redirect you created.
918
914
919
915
3. If your tests succeed, delete the existing Page Rule.
920
916
917
+
<Render
918
+
file="page-rules-migration-wildcard-notice"
919
+
params={{
920
+
requestUrl: "http*://www.example.com/*",
921
+
targetUrl: "https://example.com/${2}",
922
+
}}
923
+
/>
924
+
921
925
</TabItem> <TabItemlabel="visual guide">
922
926
923
927
| Page Rules configuration | Migrate to a single redirect |
@@ -943,27 +947,32 @@ You configured a Page Rule permanently redirecting `example.com/old-path` to `ex
943
947
944
948
1.[Create a single redirect](/rules/url-forwarding/single-redirects/create-dashboard/) to permanently redirect requests for `example.com/old-path` to `example.com/new-path`:
<Detailsheader="Notes about the rule equivalence">
10
+
11
+
The provided example using Single Redirects is not an exact match for the previously existing Page Rule in the same example.
12
+
13
+
The exact equivalent would need to match both HTTP and HTTPS incoming requests, which you could achieve using a wildcard pattern like the following (notice the extra `*` after `http`):
14
+
15
+
-**Request URL**: <code>{props.requestUrl}</code>
16
+
17
+
This would require you to also change the **Target URL** to use the second wildcard capture group instead of the first one (corresponding to the text captured by second `*` in the wildcard pattern above):
0 commit comments