HTTPS to HTTP one file

Hello!
I have a problem. My website is access HTTPS.
How to create Page Rule the access one file HTTP?

Example: https://mysite/folder/myfile.xml to http://mysite/folder/myfile.xml

Thanks!

I cannot recommend going to HTTP, but hopefully you can achieve this but you have to use Page Rule for that and regarding your settings at Cloudflare dashboard which can all be enabled to make HTTPS only (which would.

You could create a Page Rule that matches the exact file https://yourdomain.com/folder/yourfile.xml and redirects it to http://yourdomain.com/folder/yourfile.xml.

Would look like this:

If not working with it, try creating another Page Rule or generaly disabling Always use HTTPS and Automatic HTTPS Rewrites.

  • which I really do not prefer doing …

Just being curious, why your Website cannot work with HTTPS?
Does some client cannot accept or send a request to your XML file over HTTPS?

I have a need for this also

My use case is that some media players can not play https files so it is preferable to have http in these cases.

As with the OP I need this for just 1 individual file only and want Always https etc…

The first suggestion to use redirect does not work for media players

The second suggestion is also no good as I would need heaps of extra Page Rules etc… and want to force https, except for this one and only file.

Hoping there is a possible way to do it

Can you access to the file directly using an IP address (like http://i.p.v.4/folder/file.xml) or other domain?

Or, annother way would be using a sub-domain.
Add an A record for sub.yourdomain.com to Cloudflare DNS point it to your IPv4 address and make it :grey: cloud (to not use Cloudflare services for this sub-domain just because of that one file).

That way, you would access your file instad of http://yoursite.com/folder/file.xml with http://sub.yoursite.com/folder/file.xml.

Many are going the opposite direction, and require HTTPS. A recent BBC blog post stated that:

This also enables us to offer these streams securely over TLS, something which is increasingly requested by radio manufacturers and aggregators.

(Just be careful loading media through Cloudflare, check section 2.8 of the Terms of Service)

The solution to this problem that I use is to:
Enable SSL Full (Strict) as normal.
Enable Always Use HTTPS.
Enable HSTS, and add to preload list.
For the hostname and path that you need available over HTTP, set a page rule to set Always Use HTTPS to Off.

Depending on how you are loading the media, most users will end up accessing over HTTPS, but users who need to use HTTP will not be redirected. Your origin will need to respond on both HTTP and HTTPS for the assets in question.

2 Likes

I try directly ip address = file not found.

I create this rules and not work :frowning:

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