Transform Rules - Please help

I have been at this for hours. ChatGBT is failing me…

I want my URL to change from

“mydomain”.com/payment/ into “mydomain”.com/web/payment/

Is this for a URL Rewrite, or is it for a Redirect? In either case, you’ll need to use concat with http.request.uri.path, like these examples (search for “concat” on the page):

https://developers.cloudflare.com/rules/url-forwarding/single-redirects/examples/#redirect-all-requests-to-a-different-hostname

This still does not work. Must be an issue with cloudflare…

  1. How are you testing?
  2. concat("web",http.request.uri.path) in a ‘Dynamic’ URL rewrite rule will do what you want.

I assure you ^ does not work. You free for a quick zoom?

I’m not.

I have used transform, redirect, page rules nothing seems to work

I even clear cache every time… it wont change the URL. I feel like something else is blocking this from working @smarsh

It will be easier if you can give your real domain, what you are redirecting from and to, and a screenshot of the rule you have set.

I need to use Starts with to prevent circular issues.

https://staging.procelltherapies.com/payment/pay/?reference=SO79511&amount=23.38&access_token=b296643b976113c55c150d07f31fdb8d367f4989e5812a9126ed03bb6c0733f0&sale_order_id=79563&require_subscription=True&payment_term_id=21

should convert to

https://staging.procelltherapies.com/web/payment/pay/?reference=SO79511&amount=23.38&access_token=b296643b976113c55c150d07f31fdb8d367f4989e5812a9126ed03bb6c0733f0&sale_order_id=79563&require_subscription=True&payment_term_id=21


Screenshot from Transform area.

Do you want to redirect (so the client browser is told to go to the new address) or transform (so the URL gets rewritten between the client request and your origin?).

Assuming you are going to redirect, as it seems you just want to insert /web at the start of the URL, the expression should be concat("https://staging.procelltherapies.com/web", http.request.uri.path) and you need to select “Preserve query string” as well.

I want that url to automatically change to the correct functioning one.

‘concat(“https://staging.procelltherapies.com/web/payment”, http.request.uri.path’ is not a valid value for target_url because the expression is invalid: Filter parsing error (1:81): concat(“https://staging.procelltherapies.com/web/payment”, http.request.uri.path ^ expected literal “)” (Code: 20083)

Used: https://staging.procelltherapies.com/web/payment", http.request.uri.path)

Error: ‘concat(“https://staging.procelltherapies.com/web/payment”, http.request.uri.path’ is not a valid value for target_url because the expression is invalid: Filter parsing error (1:81): concat(“https://staging.procelltherapies.com/web/payment”, http.request.uri.path ^ expected literal “)” (Code: 20083)

Correction: Used: concat(“https://staging.procelltherapies.com/web”, http.request.uri.path)

I used above method and redirect still does not work

staging.procelltherapies.com isn’t proxied. It must be proxied for any rules to have any effect.

@sjr

Link still wont redirect correctly:
http s://staging.procelltherapies.com/payment/pay/?reference=SO79511&amount=23.38&access_token=b296643b976113c55c150d07f31fdb8d367f4989e5812a9126ed03bb6c0733f0&sale_order_id=79563&require_subscription=True&payment_term_id=21