Skip to content

Instantly share code, notes, and snippets.

@annelyse
Last active May 25, 2022 09:04
Show Gist options
  • Save annelyse/66a5080a7b1bf44cd5f5326da8ed9551 to your computer and use it in GitHub Desktop.
Save annelyse/66a5080a7b1bf44cd5f5326da8ed9551 to your computer and use it in GitHub Desktop.
Vérifier s'il ne reste pas des élements non sécurisé sur le site avec : https://ssl-lookup.io/
# BEGIN Redirect HTTP to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE,QSA]
</IfModule>
# END Redirect HTTP to HTTPS
//Begin Really Simple SSL Load balancing fix
$server_opts = array("HTTP_CLOUDFRONT_FORWARDED_PROTO" => "https", "HTTP_CF_VISITOR"=>"https", "HTTP_X_FORWARDED_PROTO"=>"https", "HTTP_X_FORWARDED_SSL"=>"on");
foreach( $server_opts as $option => $value ) {
if ( (isset($_ENV["HTTPS"]) && ( "on" == $_ENV["HTTPS"] )) || (isset( $_SERVER[ $option ] ) && ( strpos( $_SERVER[ $option ], $value ) !== false )) ) {
$_SERVER[ "HTTPS" ] = "on";
break;
}
}
//END Really Simple SSL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment