please guys i have problem with Rules option
i want to redirect all traffic coming from any random subdomain to an external website
i create new rules with this condition
URL (required) : *.example .com
Enter destination URL (required) : external example .com
i created also another rule with this condition:
URL (required) : .example .com/
Enter destination URL (required) : external example .com
but no one of this condition work and i really dont know why
my question is do I need to add any record in DNS table to make these rules work ??
like CNAME with wildcard (*) or in page rules it’s not necessary to add any DNS record
If they don’t exist, then the rule shouldn’t either apply for them.
You’d get the expected DNS_PROBE_FINISHED_NXDOMAIN error at first sight.
I’d say don’t even bother adding each of them to the DNS tab.
From some example cases, this wouldn’t work as expected
If so, you might be missing what comes after .com, so a better version to match would be *.example.com/*, where even the www if you’re using it, which isn’t so great.
To fix www, you’d have to use 2 Page Rules, where 1st would be the www redirect to non-www and then the 2nd rule *.example.com Forwarding URL 301 Redirect to othersite.com.
For further cases, keep an eye, the specific order has to be made of the Page Rules to make an exception for www (if so) to make it work. Also, make sure your example.com or any other sub-domain for which you’d like to apply Page Rules (hostname (DNS record) ) is proxied .
sorry but i didnt got you my problem is just i want to redirect all wildcard subdomain traffic to other static page only to one page so it not problem if ididnt send same path to redirection URL
what happend with me is when i this one *.example.com/* or this one `*.example.com/ the Rules its not working at all website is down
Despite, again, personally and from experience and other topics and issues customers have had, I am not for doing that at all. You could use to find them.
Just one example, when customers moved their domain to cloudflare, and they already have had * wildcard DNS record, in the process of scanning the existing DNS records, it created a bunch of unwanted and unknown DNS records which had to be manually removed, which of course consumes time and customer didn’t knew which sub-domain he/she had to continue using vs which are just surplus etc.