-
-
Save nocash/1f2b3d26cd1b13988e80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Force SSL URL Scheme | |
Plugin URI: https://gist.github.com/webaware/4688802 | |
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work | |
Version: 1.0.0-fork (0333d0901593e5b272df5a4e29fa7f576058031a) | |
Author: WebAware | |
Author URI: http://www.webaware.com.au/ | |
Modified By: Beau Beveridge | |
Modifications: | |
- Remove JavaScript URL rewriting. | |
- Use HTTP_X_FORWARDED_PROTO value instead of checking siteurl. | |
@ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility | |
*/ | |
/* | |
copyright (c) 2013 WebAware Pty Ltd (email : [email protected]) | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License, version 2, as | |
published by the Free Software Foundation. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with this program; if not, write to the Free Software | |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
*/ | |
// if site is set to run on SSL, then force-enable SSL detection! | |
if ( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) { | |
$_SERVER['HTTPS'] = 'on'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment