59177427 |
1 | <?php |
2e8d4c5b |
2 | |
3 | // Get the path |
8241c8d9 |
4 | $path = substr($PHP_SELF, 0, strrpos($PHP_SELF, '/')); |
8241c8d9 |
5 | |
2e8d4c5b |
6 | // Check if this is a HTTPS or regular HTTP request |
7 | $proto = "http://"; |
8 | if(isset($HTTPS) && $HTTPS == 'on' ) { |
9 | $proto = "https://"; |
10 | } |
11 | |
12 | // Get the hostname from the Host header or server config. |
13 | // Fallback is to omit the server name and use a relative URI, |
14 | // although this is not RFC 2616 compliant. |
15 | if(isset($HTTP_HOST) && !empty($HTTP_HOST)) { |
16 | $location = $proto . $HTTP_HOST . $path; |
17 | } else if(isset($SERVER_NAME) && !empty($SERVER_NAME)) { |
18 | $location = $proto . $SERVER_NAME . $path; |
19 | } else { |
20 | $location = $path; |
21 | } |
22 | |
23 | // Redirect |
24 | header("Location: $location/src/login.php\n\n"); |
8241c8d9 |
25 | exit(); |
babe7398 |
26 | ?> |