Single Page WordPress SSL Redirect

A non .htaccess way to force a SSL on a single page in WordPress

	function secure_page() {
	
	if (!is_page('registration')) { return; }
	
          if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); }
	
	}
	add_action( 'template_redirect', 'secure_page' );
Comments