Redirect loop when enable orange cloud


#1

Hey all,

I’ve got an issue with blog.webfriendly.com which I have been setting up. The main domain points to clickfunnels, while the blog subdomain points to a hosting server via an A record. When I enable the orange cloud, the site goes into a 301 redirect loop and I haven’t been able to find the answer as to why yet…
Also, (maybe this is related) the home page URL defaults to http instead of https, even though every other page on the the blog does https. I’ve checked WP general settings (tried both http and https setting) and installed the cloudflare plugin (enabled “rewrite to https”), but no dice…
So lost, plz halp…


#2

hi @learn have a look at this see if it can help

Additionally, please ensure that there is no redirect set up at your origin from http to https, as this specifically would cause the redirect loop.


#3

I saw that guide already, but no help for me there.
I figured it out partially. When I was originally trying to fix the issue with my home page not being https, I set up a rule on cloudflare:
blog.webfriendly.com/*
301 to
https://blog.webfriendly.com/$1
I disabled that and now there is no redirect loop, but now nothing on the site goes to https! I’ve got the domain setting set to flexible SSL and turned on Automatic HTTPS Rewrites in the Cloudflare WP plugin…


#4

Now I switched the general URL settings in wordpress to https. All pages go through https, but not the home page…


#5

Hi

Sorry for late reply, I just checked your .blog and main domain they both HTTPS, Did you manage to fix it?


#6

:open_mouth:

is the main blog page showing up as https for you? if you just type in the url and hit enter?


#7

Yep, all good here


#8

Frealz? That is so weird…
Cache and cookies cleared, incognito window and it goes to http version. On my mobile too (not on the same WiFi)…


#9

It’s http for me also. @danstock’s browser probably cached https url.

You can do it server side or you can create a page rule “Always use HTTPS”.


#10

@cyBerManIA yes looking like cached, was just about to mention ‘always use https’ good shout!


#11

Well, fancy that. The rule worked…
I wonder though why it did that in the first place…


#12

enable ‘always use https’ for your main domain too, as you can access it via http/https still


#13

Oh, right on. Thank you!


#14

@learn no problem , all good now


#15

Sorry to jump on but I have a sorta similar issue and can’t ask my own question…

I am a not-super-technical user who is stumped and could use some help here.

I recently set up jetpack premium for backups but couldn’t get it connected. Hosting co said “turn off cloudflare temporarily” so I did. Only now when I turn cloudflare back on I’m in the abyss of infinite loop. Dreamhost is perplexed and said “Go ask cloudflare” - so here I am.

I have strict SSL and have force https rewrite rules in my .htaccess file and on cloudflare. The infinite loop stops as soon as I shut down cloudflare. It USED to work prior to enabling jetpack - not sure if that’s relevant?

But I’m stumped. Right now enabling cloudflare breaks everything and if I can’t figure out WHY I’ll have to stop using it :frowning: Help please?


#16

@alexisdeplanque

While using Cloudflare, this is the right way to force HTTPS via .htaccess

You may try to replace your current force https rule with below.

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

This rule should work fine for you.


#17

Thanks @GulshanKumar! I am terrified of the .htaccess file but had found that on various pieces of docomentation (please know I don’t understand how to read .htaccess code). I have tired these two variants I have found:

RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
and
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Neither seem to resolve the issue with cloudflare.


#18

Hello

@alexisdeplanque
You should take backup of that file; then you may proceed it step by step.

  1. Via cPanel File Manager or SFTP

  2. Go to /public_html/ directory

  3. Before editing, it is always better idea to create a backup of .htaccess file so please, must do it right now; by creating a file with unique name e.g. ‘htaccess-backup-by-me’

  4. Now, edit .htaccess

  5. If you are using WordPress, you will see a file like this

  6. You need to place Force HTTPS rule just before any previous rewrite rules.

I hope this helps in editing .htaccess right way. Feel free to ask if you have any query.


#19

@alexisdeplanque this plugin may solve your redirect issue.

I’m in no way affiliated with that plugin, but it’s solved my redirect problems before when enabling the Cloudflare plugin :nerd_face: