Thursday, December 6, 2018

Use Strict-Transport-Security (STS) to force the use of SSL.

body{ background:linear-gradient(-10deg,white,#ccc); } Use Strict-Transport-Security (STS) to force the use of SSL.
<?php
$use_sts 
TRUE;

if (
$use_sts && isset($_SERVER['HTTPS']) {
  
header('Strict-Transport-Security: max-age=500');
} elseif (
$use_sts && !isset($_SERVER['HTTPS']) {
  
header('Status-Code: 301');
  
header('Location: https://'.$_SERVER["HTTP_HOST"].$_SERVER['REQUEST_URI']);
}
?>

No comments:

Post a Comment

form validation

function formsubmit ( ) { var empname = document .getElementById ( 'emp_name' ). value ; var email = document .getElem...