优化 index.php 优化默认首页的本地跳转
This commit is contained in:
parent
7471b17f9c
commit
532e2125c1
|
@ -124,8 +124,16 @@ if(!empty($url)) {
|
|||
} elseif(isset($_GET['fromuser']) && $_GET['fromuser']) {
|
||||
$url .= sprintf('%sfromuser=%s', $delimiter, rawurlencode($_GET['fromuser']));
|
||||
}
|
||||
header("HTTP/1.1 301 Moved Permanently");
|
||||
header("location: $url");
|
||||
$parse = parse_url($url);
|
||||
if(!isset($parse['host']) && file_exists($parse['path'])) {
|
||||
if(!empty($parse['query'])) {
|
||||
parse_str($parse['query'], $_GET);
|
||||
}
|
||||
require './'.$parse['path'];
|
||||
} else {
|
||||
header("HTTP/1.1 301 Moved Permanently");
|
||||
header("location: $url");
|
||||
}
|
||||
} else {
|
||||
require './'.$_ENV['curapp'].'.php';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue