Did you ever figure this out?
If I type in https://mydomain.com/path
It redirects to https://www.mydomain.com
It leaves the path off. I want everything to have the www.
Fortunately, yes, but your site must registered on Cloudflare. I think there’s must be a configuration on .htaccess somehow but so far nothing. Here’s my alternative configuration if you want to follow me.
1. Make sure you have setting up your site on Cloudflare (verification, domain linking, etc).
2. If you have done all above, go to “Page Rules” > “Create Page Rules”
3. Fill your non-www site on “If the URL matches” field and add asterisk (*) character after your url (ex: https://example.com/*)
4. On “Then the settings are” section, set to “Forwarding URL” > “301 – Permanent Redirect” > then type your url with www and add $1 after your url (ex:https://www.example.com/$1).
5. Hit “Save and Deploy” and activate the page rule.
6. Clean your DNS cache and browser cache (it’s additional) and test in incognito mode, if it work, congratulation. If not, maybe need time about 5 minute or less.
That’s all i know. May help you with your problem. ^^