Having issues with http being redirected to https

So I’m currently having an issue with getting things setup right with Always Use HTTPS

What I’m trying to do exactly is have every directory automatically force http connections to use https instead, but I want to have a specific folder to basically not have any redirection what so ever

Basically anything thats placed inside the loading_screens folder on the site will not have any redirects happen what so ever.

I tried doing this with page rules already in the dashboard but so far I’ve had no luck getting it to work right. I have 3 rules.

  1. Checks if the url is going to my site on http with this as the directory /loading_screens/* and then simply sets a few things such as cache stuff.

  2. Checks if the url is going to my site on http with this as the directory /* and if it is then it redirects it to https.

  3. Checks if the url is going to my site on https with this as the directory /* and then sets various settings such as caching

Logically it should be working exactly how I need it to, but for some reason it just seems like its ignoring rule 1 and skipping right to rule 2 or something. I’ll include a screenshot of the exact settings for all 3 page rules.

I tried looking into getting the http to https redirection done in php instead but its not been much success. none of the examples I’ve found for doing it actually work in the first place.

Make sure you have the global always use https disabled on the SSL/TLS tab.

I have, aswell I turned off the global automatic http rewrites aswell

Then you’re attempting to set rules in a zone not active for the domain in question or the host in question is pointing to another server/service using Cloudflare which forces https or the origin is forcing connections to https.

I don’t think thats the case. with all 3 rules turned off and the global setting set to off for always use https, it is able to properly go to any link using either https or http just fine. so its definitly not something where the host is forcing it.

As for the zone, what do you mean by “not active for the domain”? do you mean as in it doesn’t have a file located in the loading_screens directory? because if so there is a test.php which contains test the page works fine up until it comes to the page rules

It isn’t redirecting for me… so option 4… your rule doesn’t match the URI you’re typing.

So when you type this url (http://www.rapadantnetworks.org/loading_screens/test.php)
it isn’t redirecting to https:// for you? because for me its doing it both in chrom aswell as firefox. I’ve even cleared browser data completely to try and rule that out.

curl http://www.rapadantnetworks.org/loading_screens/test.php
<html>test</html>%

what about in web browsers? does it redirect for you there like it does for me?

I made a quick short recording of exactly what I’m having happen on my end to hopefully try and give a picture of whats going on better than saying. basically I want it to not redirect at all on any files in that folder but it just keeps doing it https://www.youtube.com/watch?v=qsBP4mCjzFc

If it is redirecting in a browser then the origin is doing it.

But no, it’s not redirecting.

If it were the origin doing it then wouldn’t it also be redirecting for you as well? When simply trying to go to the url in chrome it instantly redirects to https://. and in firefox it does go to http:// the first time, but both refreshing and attempting to go to it again just keeps going to https:// instead. Mean while you and a friend both are having no redirecting what so ever happen.

As for the origin theres nothing that would logically even try to redirect it. I have put nothing of the sort in the code currently on my origin that would do that, the host isn’t doing it either as going to http:// works just fine in every other domain I’ve had that used cloudflare for. I’m confused still on why its even doing this at all on my end at all. I’ve tried running ipconfig /flushdns aswell too, but it just keeps on doing this. and I really need to get this solved because the stuff in that directory needs to be served without SSL due to a specifc game which doesn’t support loadings screens that use SSL. If its redirecting for me then it has to be doing the same for others aswell and I can’t have that happening

could it be caused by HSTS being enabled maybe?

That’s what it seems. I was able to reach the URL a few times over HTTP, but after I first tried it with HTTPS, I could no longer reach it over HTTP, which is the expected behavior for HSTS:

2 Likes

I opted for moving it to a subdomain on my hosting plan instead. I was hoping to avoid this but atleast hsts lets me turn it off for subdomains so I can live with that. For future refrence what are you using to view that info in the image? just in case other issues arise in the future

Developer Tools, available in most browsers (on Chrome/Win > F12 or Ctrl-Shft-J), then check the Networks tab.

This topic was automatically closed after 30 days. New replies are no longer allowed.