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
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
- Redirect loops only happen on non-ssl pages
- Redirect loops only happen when using the option Force SSL Exclusively
- Version 1.8 didn’t have the issue
So somewhere that function (or related function) has changed, causing the redirect.
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. Please use the pastebin]
function redirect version 1.9
[Code moderated as per the Forum Rules. Please use the pastebin]
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
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!
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
Thread Starter
aacook
(@aacook)
Hi Mike, I also emailed you a login you can use for debugging.
Thanks!
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.