Skip to content

Instantly share code, notes, and snippets.

@szbl
Last active December 10, 2015 09:29
Show Gist options
  • Save szbl/4414315 to your computer and use it in GitHub Desktop.
Save szbl/4414315 to your computer and use it in GitHub Desktop.
<?php
if ( is_user_logged_in() && !is_ssl() )
{
$url = get_permalink( get_the_ID() );
$url = str_replace( 'http://', 'https://', $url );
wp_redirect( $url . '?' . http_build_query( $_GET ), 303 );
die;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment