Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Created June 20, 2012 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdevalk/2961349 to your computer and use it in GitHub Desktop.
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
<?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