这是防弹获得与别名网址 [英] is this bulletproof to get the url with alias
本文介绍了这是防弹获得与别名网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我与Apache mod_alias中因此使用工作 HTTP_POST
不给我的别名加上HTTPS它不存在。下面的线似乎工作,但可能会失败?我明白了 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
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
这篇关于这是防弹获得与别名网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文