php 怎么获取到当前访问的域名

WBOY
Release: 2016-06-13 12:15:55
Original
3635 people have browsed it

php 如何获取到当前访问的域名
我有个a域名,解析到了b域名,然后访问a,我想用php获取a域名,但是打印出来的$_SERVER['HTTP_HOST']却是b域名,php有方法能直接获取到a域名吗

echo '<pre class="brush:php;toolbar:false">';<br />    	print_r($_SERVER);<br />    	exit;
Copy after login


结果如下图:




------解决思路----------------------
a域名如何解析到b域名?
如果可以容忍js,就用location.href跳转到b
然后在b网站的$_SERVER['HTTP_REFERER']就能找到a的url
------解决思路----------------------
我是说在a网站用js跳转
------解决思路----------------------
302重定向不知道怎么捕捉
如果是js的跳转,有referer可以看到
------解决思路----------------------
你的所谓 a域名解析到b域名 是怎么弄的
域名只能解析到ip
------解决思路----------------------
用了代理嗎?
------解决思路----------------------
我有个a域名,解析到了b域名?
不理解

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!