It is possible to perform an HTTPS redirect using PHP code as well as writing PHP code to prevent the browser from caching your we

PHP
<?php
// This will redirect  to google.com
$url = "https://google.com";
header("Location: $url");  
?>header("Location: http://example.com");
die();
Source

Also in PHP: