.01
.02
.03
.04
.05
.06
.07
.08
.09
.10
.11
.12
.13
.14
.15
.16
.17
.18
.19
.20
.21
.22
.23
.24
.25
.26
.27
.28
.29
.30
.31
.32
.33
.34
.35
.36
|
|
<?php
/******************************************************************************/
/* */
/* __ ____ */
/* ___ / / ___ / __/__ __ _____________ ___ */
/* / _ \/ _ \/ _ \_\ \/ _ \/ // / __/ __/ -_|_-< */
/* / .__/_//_/ .__/___/\___/\_,_/_/ \__/\__/___/ */
/* /_/ /_/ */
/* */
/* */
/******************************************************************************/
/* */
/* Titre : Passez de http à https avec une redirection automatique */
/* */
/* URL : http://www.phpsources.org/scripts305-PHP.htm */
/* Auteur : Jo-bar57 */
/* Date édition : 14 Oct 2007 */
/* */
/******************************************************************************/
// prend l'url
$url = $_SERVER['SCRIPT_URI'];
// Parse l'url
$base = parse_url($url);
// Creation du chemin
$chemin = $base[host].$base[path];
// Si le protocole est different de https
if($base[scheme] != "https"){
// redirection
header("Location: https://$chemin");
exit();
}
?>
|