Redirect wildcards from subdomain to directory



Hello :slight_smile:

I really love Free SSL from CF and other features that speed up my website :).

Im not complete newcomer as I’ve used CF for a while yet its my first time im encountering a serious problem I cannot solve

I have a subdomain (I hope pasting urls is okay, if not then sorry and feel free to remove it or tell me so i correct the post!).

The subdomain url is:

And a domain:

Now domain is connected to Cloudflare and its all smooth, yet im having really hard times doing a wildcard (*) redirect.

Im trying to achieve simple redirecting mechanism that would take all urls like: /example-page-id-100

And redirect them to: /folder-of-my-choice/example-page-id-100

Here are my DNS settings:
[image removed by staff]

Heres my page rule settings:

Only one redirect. What above does if sending all urls matching the asterisk (wildcard) which is good, but its sending all of them just to one destination url

When I set /folder-of-my-choice/* as a destination, then it redirects them all again to the same destination page, and adds * to the address instead of assigning the same page slug as before

Is it possible to achieve what I want in Cloudflare? :slight_smile: Maybe im trying to set something impossible…

Thanks in advance!


ohh I looked in Documentation and instead of * i was supposed to add dollar and 2. for example /folder/$2

where $2 will “copy” the path it had before.

I guess I didnt need to post here :smiley: hope thats not a problem


No problem at all. Just a heads up that I deleted the screenshot that showed your IP information. For security purposes we typically discourage revealing that unless absolutely necessary.