Created
June 20, 2012 18:14
-
-
Save jdevalk/2961349 to your computer and use it in GitHub Desktop.
WordPress code to redirect non-admin and non-login pages to http when opened over https
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 | |
// If we're not on an admin or login page, make sure we're not on https. | |
if ( !is_admin() && strpos($_SERVER['REQUEST_URI'], 'login.php') === false && $_SERVER['HTTPS'] == 'on' ) { | |
wp_redirect( "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], 301 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment