Plugin Caused a Redirect Loop
-
Using Cloudways managed WordPress hosting and installed this plugin to handle the SSL redirect logic. Immediately after saving the settings the website began experiencing a redirect loop. I cleared my cache, used different browsers, used mobile browsers, had friends try from different locations, and used a VPN to try and load the site, all of which resulted in the redirect loop messaging.
I reached out to Cloudways support and they told me that the code in the .htaccess file looked wrong.
Cloudways support used the following redirect code in the htaccess and it worked. The redirect loop message disappeared and the HTTP url variants began redirecting to the target HTTPS variant:
RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
This is the code that did not work which was inserted by the Easy HTTPS Redirection plugin:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule>
- The topic ‘Plugin Caused a Redirect Loop’ is closed to new replies.