Does Cache everything interfere with 301 redirect?


#1

I enabled a 301 redirect via htacces to HTTPS over a week ago.

Yesterday I enabled cache everything on cloudflare

Today I noticed 301s to http were not redirecting to https!?

I enabled Allways on for https on Cloudflare and that worked.

My question is would cache everything interfere in a 301 redirect? (htaccess is 301 but it seems to ignore it)


#2

I have 301s that redirect www to non-www, and they work with Cache Everything.


#3

I “think” I’ve worked it out. For some reason 301s stoped working. It seems when I had “cache everything” enabled for 30 days during it’s initial crawl it picked up the too many loops error page and cached them.

Once I set it to 4 hours. The loop error pages stopped. Well, at least so far.


#4

301s get cached as described in https://support.cloudflare.com/hc/en-us/articles/200168326-Are-301-and-302-redirects-cached-by-Cloudflare- and https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-Cloudflare-What-to-Cache-

You might want to consider performing the 301 redirect with a Page Rule, instead of .htaccess.

If you want to just turn HTTP to HTTPS you could also consider the “Always use HTTPS” and the HSTS settings that do not consume Page Rules.


#5

Link one answered. Thank you.

“Always use HTTPS” is now on. It seems to have resolved the problem. 301s with redirects or errors were for sure being cached at the time. Glad I caught in on time :slight_smile: