0

No matter what, I keep getting "ERR_TOO_MANY_REDIRECTS". Is there a "proper" way to redirect all http requests to https? (other than the five listed below...)

I have this:

<VirtualHost *:80>
ServerName example.com
Redirect permanent / https://example.com/
</VirtualHost>

I also tried the top four answers in this article: http to https apache redirection. Nothing works, all infinite redirects.

Jesse
  • 750
  • 1
  • 9
  • 25
  • The methods in the referenced post are all valid, tried and true solutions. Besides that VirtualHost for port 80, I expect you have a VirtualHost for port 443? Show us, there might be a rewrite in that VirtualHost creating the loop. – Nic3500 Sep 28 '18 at 10:58

2 Answers2

0

Please try following:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]

As others said, If you share you config file, it would be more easy to answer. Probably, some config cause a loop.

skalkanci
  • 61
  • 1
  • 7
0

My problem was a WordPress plugin...

Solution: Set Paid Memberships Pro Stripe Gateway "force SSL" setting to "No"

Considerations that got me here: 1. EVERY suggestion for configs works, my config files work on nearly 100 sites I manage. 2. I have a near-identical WP site to this and it works. 3. I started re-activating plugins one by one.

The problem I found:

On first activation, Paid Memberships Pro detects http or https, then permanently disables "force SSL" setting on an https site. My working site had this happen, so no problem. My broken site had PMP installed on http, then I got the SSL cert later. SSL (Yes via JavaScript) created a non-breaking redirect loop. Turning off "force SSL" did the trick.

Moral of my story: When using WP, deactivate plugins before asking for help.

Jesse
  • 750
  • 1
  • 9
  • 25