Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 apache mod_alias 所以使用HTTP_POST不会给我别名加上 HTTPS 它不存在。下面的行似乎有效,但它会失败吗?我知道SERVER_NAME需要在服务器上进行配置,但前提是这样可以吗?
HTTP_POST
SERVER_NAME
$site_url = $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["SERVER_NAME"] . $_SERVER["CONTEXT_PREFIX"];
我用:
$_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']
示例输出:
https://example.com/alias-no-extension?query=1