Subdomains & redirect rules

I want to use subdomains as a way to direct traffic from what looks like a subdomain to a page within the site

For example I want to use commercial.domain.co.uk to redirect to the url https://www.domain.co.uk/commercial.html

I created a page rule: if hostname contains commercial redirect to the URL and deployed it

I have two issues:

  1. if I use www.commercial.domain.co.uk or https://www.commercial.domain.co.uk it doesnt work, just times out, without www and straight https://www.commercial.domain.co.uk

  2. if I create multiple rules for multiple subdomain to URL redirects some work some dont

I’ve obviously missed something

Also do I need to create an A record for the subdomain, pointed at site IP for these or can I just create rules to give the impression of using subdomains?

Or am I simply approaching this wrong?

Cheers

You need to create an A (or AAAA) record as your dummy hostname needs to resolve for Cloudflare to handle it, and it needs to be proxied. Just give it an IP address of 192.0.2.1 (100:: for AAAA) if never needs to use your origin and is just for redirection.

You will also need the advanced certificate manager due to the depth of your subdomains for www.commercial.domain.co.uk

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