force https except one page/post

I just used this in the functions file in the end

function force_ssl()
{
    // Specify ID of page to be viewed on SSL connection
if (is_page(8616) && !is_ssl () )
{
  header('HTTP/1.1 301 Moved Permanently');
  header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
  exit();
}
// All other pages must not be https
else if (!is_page(8616) && is_ssl() )
{
    header('Location: http://' . $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
    exit();
}
}      
add_action('template_redirect', 'force_ssl');