Title: Version 4.0 Forcing HTTPS
Last modified: August 22, 2016

---

# Version 4.0 Forcing HTTPS

 *  [BitsNStuff](https://wordpress.org/support/users/bitsnstuff/)
 * (@bitsnstuff)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/)
 * Anyone able to use port 80 after upgrading to version 4.0 ? I played around with
   this for a while and narrowed down the culprit to my upgrade from version 3.9.2
   to 4.0 .. now all port 80 requests get redirected to port 443 automatically. 
   Due to my configuration it caused a redirect loop.

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

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274689)
 * Do you have your URLs in the Settings->General page set to be https? Or are you
   using any plugins to force https?
 *  Thread Starter [BitsNStuff](https://wordpress.org/support/users/bitsnstuff/)
 * (@bitsnstuff)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274702)
 * Hi Samuel. No nothing I could find that would be causing this behavior. After
   numerous hours and several days I thought I’d try just copying the version 3.9.2
   files manually back over to my wordpress staging directories, and after doing
   that the problem disappeared. I honestly don’t have the time or knowledge to 
   start going through those php files trying to figure out which specific lines
   of code were the cause.
 * I could reproduce this quite easily. First do the 4.0 upgrade, and then within
   nginx use only a single server that responds on port 80. The result should be
   website not responding.
 * I don’t have a vital need to solve this, because on my web-facing server I just
   left it at version 3.9.2 .. I just thought I’d see if anyone else had experienced
   the same problem, and to bring this to peoples’ attention.
 *  Thread Starter [BitsNStuff](https://wordpress.org/support/users/bitsnstuff/)
 * (@bitsnstuff)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274705)
 * I just looked at the Settings->General page, and yes the urls there are set to
   https. In my notes I show that I had originally changed them to http so that 
   creating new posts, pages, and multimedia would all be addressed in the database
   using http (which is what I wanted). It appears then that doing the 3.9.2 to 
   4.0 upgrade changed these to https.
 * I’ll do a bit more experimenting to see if I can perform the upgrade, then change
   those urls back to http and hopefully make this redirect problem go away.
 *  Thread Starter [BitsNStuff](https://wordpress.org/support/users/bitsnstuff/)
 * (@bitsnstuff)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274707)
 * I just tested out this theory, and I am confirming that the https redirects were
   all caused by those two urls on the General->Settings page being set to https.
   However I think part of the 3.9.2 to 4.0 upgrade is to change them (in the database)
   to https if they’re not that way already.
 * I did the upgrade to 4.0 , and then changed them back to http on the General-
   >Settings page. After logging out of wordpress I navigated to a generic http 
   root page and the redirect problem had disappeared.
 * Thanks for your help Samuel!
 *  Thread Starter [BitsNStuff](https://wordpress.org/support/users/bitsnstuff/)
 * (@bitsnstuff)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274716)
 * I just performed the 4.0 upgrade on my web-facing server, and afterward the schemes
   had not been changed to https, so I have to apologize at the false alarm. On 
   my staging server I either did not set those schemes like I thought I did, or
   some other plugin or theme had set them to https.
 * Anyway, this is all great information for me to have. Thanks again for the help.
 *  [burnsie](https://wordpress.org/support/users/burnsie/)
 * (@burnsie)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274771)
 * I am seeing this too – when I upgrade to 4.0 I am getting a 301 – permanent redirect
   loop back to itself.
 * I use https:// prefixes on my URLs.
 * When I change the home and siteurl in the database to http:// it all works again
   as normal.
 * I’ve disabled all plugins and the redirect still seems to be happening… any ideas?
 *  [susheelhbti](https://wordpress.org/support/users/susheelhbti/)
 * (@susheelhbti)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274780)
 * I’ve disabled all plugins and the redirect still seems to be happening… any ideas?
 * some time browser caches it so try from other machine it will work
 * _[[Signature moderated](http://codex.wordpress.org/Forum_Welcome#Signatures)]_
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [11 years, 7 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274784)
 * > I just tested out this theory, and I am confirming that the https redirects
   > were all caused by those two urls on the General->Settings page being set to
   > https. However I think part of the 3.9.2 to 4.0 upgrade is to change them (
   > in the database) to https if they’re not that way already.
 * The 4.0 upgrade would not have modified those URLs, as it doesn’t have any code
   to do that.
 * However, if they had https in them from before, then 4.0 would now do something
   that previous versions would not have, and attempt to force https everywhere.
   The ticket in question is here:
    [https://core.trac.wordpress.org/ticket/27954](https://core.trac.wordpress.org/ticket/27954)
 * Essentially, WordPress treats those two URLs on the Settings->General screen 
   as equivalent to the word-of-god. Those are the addresses for the site, and nothing
   will change that. 🙂
 * So, if you have https in those, then the site is https-only and that is just 
   how it is. It will enforce those addresses, and redirect all http using heathens
   to https instead.
 * If your site isn’t actually capable of https, then this is a problem. So make
   sure those URLs are correct. They cannot be incorrect in any way.
 *  [burnsie](https://wordpress.org/support/users/burnsie/)
 * (@burnsie)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274810)
 * Hi Samuel,
 * I can confirm that the 4.0 upgrade is not changing my URLs, I’ve set them to 
   https:// myself and my web host ONLY accepts HTTPS, port 80 is closed.
 * Something is redirecting my https requested back to the same https URL as of 
   WordPress 4.0 that it wasn’t doing in 3.9.x.
 *  [jhirschi](https://wordpress.org/support/users/jhirschi/)
 * (@jhirschi)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274899)
 * Same here. Have a working ssl-enabled site with WordPress and Site URLs set to
   [https://](https://wordpress.org/support/topic/version-40-forcing-https/?output_format=md),
   the purpose being to make the site default to https. After upgrading to WordPress
   4.0, get a redirect loop. WordPress 4.0 with WordPress and Site URLs changed 
   to http:// eliminates the redirect loop, but the site is not longer defaulting
   to https.
 *  [jhirschi](https://wordpress.org/support/users/jhirschi/)
 * (@jhirschi)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274900)
 * Fixed by coding
    define(‘FORCE_SSL’, false); in wp-config.php
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [11 years, 6 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274901)
 * burnsie: Try adding this to your wp-config.php file, at the top, with the other
   defines:
 *     ```
       if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
              $_SERVER['HTTPS']='on';
       }
       ```
   
 * In cases where your host is doing reverse proxying for SSL, then this code will
   force WordPress to recognize that case.
 *  [burnsie](https://wordpress.org/support/users/burnsie/)
 * (@burnsie)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274902)
 * > burnsie: Try adding this to your wp-config.php file, at the top, with the other
   > defines:
   > if ($_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’) {
   >  $_SERVER[‘HTTPS’]=’on’;}
 * Thanks Samuel, this is what I ended up doing to fix it.

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

The topic ‘Version 4.0 Forcing HTTPS’ is closed to new replies.

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [redirect loop](https://wordpress.org/support/topic-tag/redirect-loop/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 13 replies
 * 5 participants
 * Last reply from: [burnsie](https://wordpress.org/support/users/burnsie/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/version-40-forcing-https/#post-5274902)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
