Creating subdomains and/or page rules -- so lost!


#1

I have my domain hosted by Cloudfare and now want to create shorter subdomain for certain pages in my website – my website automatically creates names too long – so I want to create something like www.dignityu.com/sponsor.

I need to create about 30 of these – how do I do this?

When I ask support, they say something about page rules, forwarding, and subdomains – but I am not good at this and it all confuses me.

Thanks!


#2

Hi @mikedilbeck, it may be best to first familiarize yourself with the concepts that support mentioned to you, this is a good read on Page Rules and how to use them for forwarding https://blog.cloudflare.com/introducing-pagerules-url-forwarding/ and this is an equally good read on subdomains, https://support.cloudflare.com/hc/en-us/articles/200168756-How-do-I-add-a-subdomain-to-my-site-.


#3

Thanks so much! At the time I posted this, I could not – for the life of me – locate the email where support shared these articles. I have now found it and have referred to these – thank you so much! I am pretty clear now that page rules are what I need to be using – of course, I hate that I have to pay for these.


#4

Hi @mikedilbeck, understood. In the first link, the section on wildcards and variables may help minimize how many rules you need, (especially if your site generates a format that complements your rules!).


#5

It’s very clear how to redirect all subdomains to another url, *.example.com, but how do I redirect the root, example.com and one subdomain to another url? For example, I need route example.com and www.example.com, only, to www.example2.com, but leave the other subdomains alone.


#6

You’ll need two specific rules. One to match example.com/* and one to match www.example.com/*

The first one has no wildcard in front of ‘example’, so it won’t match any subdomains.