Troubleshooting dynamic redirect "cannot find ending quote" error

Hi folks - this is a permutation of a puzzle I was wrestling with a few months ago, and I’m encountering a fresh error :sweat_smile:

I’m trying to dynamically redirect this URL:

https://londonpass.com/**en-us**/guidebook/great-pass

… to this parameterised URL:

https://mypass.gocity.com/guidebook?destination=london&language=**EN**&passType=ALL_INCLUSIVE&brand=GREAT

… while capturing & passing through the language code. I’m using a Cloudflare example as the basis for the regex to capture the language code - https://developers.cloudflare.com/rules/url-forwarding/single-redirects/examples/#remove-locale-information-from-url-path.

The dynamic redirect rule I’m using is:

concat("https://mypass.gocity.com/guidebook?destination=london“, regex_replace(http.request.uri.path, “^/([A-Za-z]{2,3})-[A-Za-z]{2}/.*”,“&language=${1}&passType=ALL_INCLUSIVE&brand=GREAT”))

But I’m getting an error message that says it “cannot find an ending quote”

Reading that rule, I can’t see what I’m missing. I’ve wrapped the initial string in quotes, and both the capture & replace rules in the regex_replace function.

What am I missing?

UGH - I can’t seem to edit the post, but obviously the language encoding doesn’t actually include the markdown for “bold”. I was just trying to create visual structure, and then realised I had to wrap all URLs as pre-formatted.

Apologies for any confusion.

Resolved the issue - it turns out I’d missed that I was using non-standard quote marks. Swapped those all out & did some unicode housekeeping, and it’s resolved.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.