//判断跳转
$domain_url = $this->request->url(); //不含域名 如'/html/about/content/1800407.html';
//打开json文件,读取数据
$file_json = $this->request->domain().'/static/index/common/urls.json';
$string = http_request($file_json);
$data = json_decode($string, true);
//dump($data);exit();
//循环表格数据,如果有相同的则实现跳转
foreach ($data as $key => $value) {
if ($domain_url == $value['curr']) {
$this->redirect($value['jump']);
}
}
//dump($domain_url);exit();
}
/**
USER | www |
HOME | /home/www |
HTTP_CONTENT_LENGTH | 141 |
HTTP_POSTMAN_TOKEN | 3ccf730f-2173-bbdf-fbf3-f192b352a951 |
HTTP_CONTENT_TYPE | multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW |
HTTP_CACHE_CONTROL | no-cache |
HTTP_CONNECTION | keep-alive |
HTTP_ACCEPT | */* |
HTTP_ACCEPT_ENCODING | deflate, gzip |
HTTP_HOST | media.digikey.com |
PATH_INFO | |
REDIRECT_STATUS | 200 |
SERVER_NAME | www.mornsun-power.com |
SERVER_PORT | 443 |
SERVER_ADDR | 172.18.60.110 |
REMOTE_PORT | 33168 |
REMOTE_ADDR | 18.224.216.132 |
SERVER_SOFTWARE | nginx/1.18.0 |
GATEWAY_INTERFACE | CGI/1.1 |
HTTPS | on |
REQUEST_SCHEME | https |
SERVER_PROTOCOL | HTTP/1.1 |
DOCUMENT_ROOT | /www/wwwroot/www.mornsun-power.com/public |
DOCUMENT_URI | /index.php |
REQUEST_URI | /html/pdf/B0512LS-1WR3.html |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | 141 |
CONTENT_TYPE | multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW |
REQUEST_METHOD | GET |
QUERY_STRING | s=/html/pdf/B0512LS-1WR3.html |
SCRIPT_FILENAME | /www/wwwroot/www.mornsun-power.com/public/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1620002362.5892 |
REQUEST_TIME | 1620002362 |
ROOT_PATH | /www/wwwroot/www.mornsun-power.com/public/ |