is this bulletproof to get the url with alias

I am working with apache mod_alias so using HTTP_POST doesn't give me the alias plus with HTTPS it's not there. The below line seems to work but could it fail? I understood SERVER_NAME needs to be configured on server but provided it is this ok?

$site_url = $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["SERVER_NAME"] . $_SERVER["CONTEXT_PREFIX"];

I use:

$_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']

Example Output:

https://example.com/alias-no-extension?query=1
链接地址: http://www.djcxy.com/p/42256.html

上一篇: POST与$

下一篇: 这是防弹,以获得与别名的网址