fix redir
This commit is contained in:
parent
1e2d754561
commit
1b8d19f6c7
12
index.php
12
index.php
@ -14,13 +14,17 @@ $dynamic_page_dir = "dynamic/";
|
||||
$subdomain = basename(explode('.', $_SERVER['HTTP_HOST'])[0]);
|
||||
$page_name = basename($_SERVER["QUERY_STRING"]);;
|
||||
|
||||
if(empty($page_name)){
|
||||
$page_name = "index";
|
||||
}
|
||||
|
||||
|
||||
$srvname = $_SERVER["SERVER_NAME"];
|
||||
|
||||
$protocol = $_SERVER['PROTOCOL'] = isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) ? "https://" : "http://";
|
||||
|
||||
if (empty($page_name)){
|
||||
header("Location: $protocol$srvname/$default_page");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$dynamic_page_file = $page_dir . $subdomain . "/" . $page_name . ".php";
|
||||
$page_file = $page_dir . $subdomain . "/" . $page_name . ".html";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user