/source/module/app.php
// 确定协议 (http 或 https) $server_request_scheme = ( (isset($_SERVER['REQUEST_SCHEME']) && $_SERVER['REQUEST_SCHEME'] == 'https') || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_FROM_HTTPS']) && $_SERVER['HTTP_FROM_HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ) ? 'https://' : 'http://'; // 获取域名 $frontendDomain = $_SERVER['SERVER_NAME']; // 组合完整的 URL $url = $server_request_scheme . $frontendDomain . $_SERVER['REQUEST_URI']; $zurl = $server_request_scheme . $frontendDomain; // 检查当前 A 链接 跳转 B 链接 if ($url === $zurl . '/about/' || $url === $zurl . '/about') { // 跳转到 B 链接 header('Location: ' . $zurl . '/p/about.html'); exit; }
上一篇:产品搜索
下一篇:已经是最后一篇