Query parameters wiped in url forwarding page rules


#1

I’ve set up rules to forward subdomain urls to the root domain with utm parameters afterwards and the subdomain as one of the parameters (better Google Analytics campaign tracking).

But, in my testing, the query parameters seem to be wiped and the redirect is only to the root domain.

My rule is as follows:

URL Matching: *.oakwear.co/*
Settings: Forwarding URL
Redirect: 301 Permanent
Output URL: https://oakwear.co/$2/?utm_campaign=shopify-v1.0&utm_medium=social&utm_source=$1

What am I missing? Would really appreciate some help!


#2

Hey @oakwearco,

Everything works fine from what I seeing. I tested the URL www.oakwear.com/test and I’m redirected to https://oakwear.co/test/?utm_campaign=shopify-v1.0&utm_medium=social&utm_source=www, which is compliant with what is configured in your page rule.


#3

Hi @stephane ! Thanks for testing it out.

The desired use case is as follows and in my tests doesn’t seem to happen consistently:

  1. ap.oakwear.co => https://oakwear.co/?utm_campaign=shopify-v1.0&utm_medium=social&utm_source=ap

  2. sa.oakwear.co/contact => https://oakwear.co/contact/?utm_campaign=shopify-v1.0&utm_medium=social&utm_source=sa

For both of these tests, it doesn’t seem to redirect including the utm parameters specified in the page rules.


#4

ap and sa doesn’t seems to be Cloudflare activated :grey: :frowning: that’s why the requests are not triggering your page rule and then, the redirection is not the good one.


#5

How do I go about activating subdomains on Cloudflare? I guess more precisely above I was trying to use the subdomain as a wildcard variable for url forwarding, is that not possible?


#6

Hi,

Refer to this article for information on adding subdomains:

The Page Rule is working for the www subdomain as Stephane stated earlier, so once these are added you should be all set.

Edit: Cloudflare will only proxy wildcards on the Enterprise plan. For a Page Rule to apply to a subdomain it must be proxied, so if you add the specific subdomains that you want proxied and :orange: the DNS record it will take precedence over the wildcard record.


#7

@andy thanks for the links! I’ll go ahead and manually setup the subdomains for proxying. Any plans to allow proxy wildcards for lower plans?