插件代码上传
This commit is contained in:
25
plugin/404/include.php
Normal file
25
plugin/404/include.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
function zxd_ctrlcenter_404(){
|
||||
global $zbp;
|
||||
if(!$zbp->Config('zxd_ctrlcenter')->plugin_404_Enable)
|
||||
return false;
|
||||
|
||||
if (!in_array("Status: 404 Not Found", headers_list())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$url = $zbp->Config('zxd_ctrlcenter')->plugin_404_redirect_url;
|
||||
|
||||
$delay = $zbp->Config('zxd_ctrlcenter')->delay ?: 0;
|
||||
if ($url && preg_match("/^http[s]?:\/\/.+\.\w+/", $url)){
|
||||
// 采用 js 跳转兼容性好
|
||||
if ($delay==0 && function_exists("RedirectByScript")) {
|
||||
RedirectByScript($url);
|
||||
}else{
|
||||
// 采用 html
|
||||
echo '<meta http-equiv="refresh" content="0;url=' . $url . '">';
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user