Hello everybody,
Please can somebody help me find out how to redirect all http traffic into https with xampp?
thanks in advance.
Salento9.
danvasile at pentest dot ro
21-Mar-2007 02:22
If you have problems with $_SERVER['HTTPS'], especially if it returns no values at all you should check the results of phpinfo(). It might not be listed at all.
Here is a solution to check and change, if necessary, to ssl/https that will work in all cases:
- Code: Select all
<?php
if ($_SERVER['SERVER_PORT']!=443) {
$sslport=443; //whatever your ssl port is
$url = "https://". $_SERVER['SERVER_NAME'] . ":" . $sslport . $_SERVER['REQUEST_URI'];
header("Location: $url");
}
?>
Of course, this should be done before any html tag or php echo/print.
Users browsing this forum: No registered users and 111 guests