Can be used in PHP. header() Use a function to navigate to the current domain. /e/admin Table of Contents – You can use it. $_SERVER['HTTP_HOST'] Retrieve the current domain name, then compare it with /e/admin Assemble them together and use them finally. header() Use a function to redirect. Here is an example code snippet:
<?php
// 获取当前域名
$domain = $_SERVER['HTTP_HOST'];
// 拼接 URL
$url = "http://{$domain}/e/admin";
// 跳转到 URL
header("Location: $url");In this example, we first use $_SERVER['HTTP_HOST'] Retrieve the current domain name and save it to $domain Variable. Then, we will map the domain name to /e/admin Combine the results and save them to $url Variable. Finally, we use it. header() The function redirects the browser to $url。