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