Created
July 23, 2015 17:11
-
-
Save thefuxia/e0ea08040d16dd671201 to your computer and use it in GitHub Desktop.
T5 Fix HTTPS header on Apache
This file contains 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 # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Fix HTTPS header on Apache | |
* Version: 2015.07.23 | |
* Author: toscho | |
* Author URI: http://toscho.de | |
* License: MIT | |
*/ | |
if ( empty ( $_SERVER['SERVER_SOFTWARE'] ) ) | |
return; | |
if ( FALSE === stristr( $_SERVER['SERVER_SOFTWARE'], 'apache' ) ) | |
return; | |
if ( empty ( $_SERVER['HTTPS'] ) ) | |
return; | |
if ( '1' === $_SERVER['HTTPS'] ) | |
$_SERVER['HTTPS'] = FALSE; | |
if ( '1' === $_SERVER['HTTP_HTTPS'] ) | |
$_SERVER['HTTP_HTTPS'] = FALSE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment