9 lines
No EOL
318 B
PHP
9 lines
No EOL
318 B
PHP
<?php
|
|
//If the HTTPS is not found to be "on"
|
|
if(!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != "on")
|
|
{
|
|
//Tell the browser to redirect to the HTTPS URL.
|
|
header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"], true, 301);
|
|
//Prevent the rest of the script from executing.
|
|
exit;
|
|
} |