Title: WordPress HTTPS: This webpage has a redirect loop
Last modified: August 20, 2016

---

# WordPress HTTPS: This webpage has a redirect loop

 *  Resolved [aacook](https://wordpress.org/support/users/aacook/)
 * (@aacook)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/)
 * I’ve used this plugin before, but today I am getting this error:
    This webpage
   has a redirect loop.
 * I tried to debug for a few hours… looking all over Google, on this forum, etc…
   and I’ve had zero luck.
 * Is this a bug with the latest version?
 * -I am not using Shared SSL
    -Tried updating all plugins and to the latest wordpress
   core -Tried deactivating all plugins except this plugin -I know SSL works since
   I can browse to a file directly on the server and it’s served up via SSL just
   fine
 * Anyone else experiencing this issue?

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199553)
 * Hey aacook,
 * Redirect loops happen on sites for a number of reasons. Please provide the settings
   you have enabled and a link to a broken page.
 * Thanks,
    Mike
 *  [timbunch](https://wordpress.org/support/users/timbunch/)
 * (@timbunch)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199636)
 * I started having this issue after upgrading as well. I quickly downgraded my 
   public site and it works again. 1.9.0 and 1.9.1 both have the same issue for 
   me.
 * **More Details**
    1. Redirect loops only happen on non-ssl pages
    2. Redirect loops only happen when using the option **Force SSL Exclusively**
    3. Version 1.8 didn’t have the issue
 * So somewhere that function (or related function) has changed, causing the redirect.
 *  [timbunch](https://wordpress.org/support/users/timbunch/)
 * (@timbunch)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199637)
 * I replaced the updated function (1.9) with the outdated function (1.8) and my
   issue is resolved. However, the redirect function no longer works at that point
   either.
 * **function redirect version 1.8**
    _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * **function redirect version 1.9**
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199639)
 * Hi timbunch,
 * Well, that makes sense considering I completely changed the argument in that 
   method from boolean in 1.8.5 to either ‘http’ or ‘https’ in 1.9. I wouldn’t expect
   the old method to work. 😛
 * I imagine what’s happening is is_ssl method is throwing a false positive due 
   to some kind of proxying going on with your server configuration. The redirect
   loop is most likely caused by this conditional in the is_ssl method.
 *     ```
       if ( isset($_SERVER['HTTP_X_FORWARDED_SERVER']) && !is_ssl() && strpos($this->https_url, $_SERVER['HTTP_X_URL_SCHEME'] . '://' . $_SERVER['HTTP_X_FORWARDED_SERVER']) !== false ) {
       	return true;
       }
       ```
   
 * Try replacing the method with this one:
 *     ```
       function is_ssl() {
       	// Some extra checks for proxies and Shared SSL
       	if ( $this->shared_ssl == 1 && isset($_SERVER['HTTP_X_FORWARDED_SERVER']) && !is_ssl() && strpos($this->https_url, $_SERVER['HTTP_X_URL_SCHEME'] . '://' . $_SERVER['HTTP_X_FORWARDED_SERVER']) !== false ) {
       		return true;
       	} else if ( $this->shared_ssl == 1 && !is_ssl() && strpos($this->https_url, $_SERVER['HTTP_HOST']) !== false ) {
       		return true;
       	}
       	return is_ssl();
       }
       ```
   
 * Let me know if that prevents the redirect loops.
 * Thanks,
    Mike
 *  [yonisink](https://wordpress.org/support/users/yonisink/)
 * (@yonisink)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199641)
 * Mike-
    I came here with the **exact** same problem and replaced the function 
   with your new one and it works great. Time for a new .001 version! Thanks much
   for a great plugin and greater support!
 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199643)
 * Hi yonisink,
 * Would you let me conduct some tests on your site? I’d like to be able to figure
   out exactly why this conditional is returning true. I have a pretty good idea,
   but it doesn’t seem to make sense.
 * If you want, you can email me an admin login to mike[at]mvied[dot]com. If you
   don’t want to create an admin account for me on your live site, a separate WordPress
   install on the same server would work. I’d love to be able to test some bug fixes
   in it. The code that I proposed really isn’t viable for all server configurations.
 * Thanks,
    Mike
 *  [yonisink](https://wordpress.org/support/users/yonisink/)
 * (@yonisink)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199662)
 * Mike – I emailed you
 *  Thread Starter [aacook](https://wordpress.org/support/users/aacook/)
 * (@aacook)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199663)
 * Hi Mike, I also emailed you a login you can use for debugging.
 * Thanks!
 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199682)
 * For the record, aacook’s redirect issue was being caused by his theme always 
   redirecting back to HTTP. Very strange behavior for a theme.
 * Yonisink’s issue was a bug in 1.9.1 that will be fixed in 1.9.2 which will be
   released very soon.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘WordPress HTTPS: This webpage has a redirect loop’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-https_bec2c9.svg)
 * [WordPress HTTPS (SSL)](https://wordpress.org/plugins/wordpress-https/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-https/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-https/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-https/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-https/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-https/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [mvied](https://wordpress.org/support/users/mvied/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-https-this-webpage-has-a-redirect-loop/#post-2199682)
 * Status: resolved