Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created July 23, 2015 17:11
Show Gist options
  • Save thefuxia/e0ea08040d16dd671201 to your computer and use it in GitHub Desktop.
Save thefuxia/e0ea08040d16dd671201 to your computer and use it in GitHub Desktop.
T5 Fix HTTPS header on Apache
<?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