how to implement wildcard 301 in Cloudflare’s new “redirect rules”
- This topic is empty.
-
AuthorPosts
-
KathrynGuest
This has been driving me crazy. They are getting rid of the Page Rules. And new the Redirect Rules does not support the
*
wildcard and$1
target syntax anymore and there is no option for this in the drop down regex.NicholasGuestDo you have to pay for this now? What happened? NO EXPLANATION
KennethGuestI can’t find it right now. But I saw in the Developer docs a few days ago that wildcards are now only supported in the Business or Enterprise plan. Not sure if it’s accurate. But I saw them say it somewhere like that.
ChristopherGuestI see only:
https://developers.cloudflare.com/rules/page-rules/reference/wildcard-matching/
Page Rules are deprecated. You should consider alternative Rules options due to their enhanced configurability. Refer to the migration guide for details.
LoganGuesthttps://community.cloudflare.com/t/static-vs-dynamic-redirects/584719/5
“Redirect Rules/Ruleset Engine does not support wildcard characters like that.
There is regex/matches support, but only for Business Plans or higher.”welp.
AmberGuestGIVE US BACK OUR WILDCARDS CLOUDFLARE
ChristopherGuestthere’s a workaround using
concat
andsubstring
but it’s pretty ugly and it doesn’t work as well in my tests, a CF employee mentions it on their forum.Filter expression:
(starts_with(http.request.uri.path, "/old-path/"))
Dynamic URL redirect expression:
concat("/new-path/", substring(http.request.uri.path, 10))
where start byte value (10 in my example) is the length of the old path.
source
https://community.cloudflare.com/t/dynamic-wildcard-redirect-rule/657658/2FrancesGuestwow, looks easy! /s
🥺
AngelaGuestI really hope they make a UI option for this, because it’s too difficult
-
AuthorPosts