How PHP Gets the domain name that is currently accessed

Source: Internet
Author: User
How PHP Gets the domain name that is currently accessed
I have a domain name, resolved to the B domain name, and then access a, I want to use PHP to get a domain name, but the printed $_server[' Http_host ' is a b domain, PHP has a way to directly get to a domain?

Echo '
';
Print_r ($_server);
Exit


Results such as:




------to solve the idea----------------------
How does a domain name resolve to the B domain?
If you can tolerate JS, use location.href jump to B
Then on the B site $_server[' Http_referer ' will find the URL of a
------to solve the idea----------------------
I mean, in the a site with JS Jump
------to solve the idea----------------------
302 redirects don't know how to capture
If it is JS jump, there is referer can see
------to solve the idea----------------------
Your so-called a domain name resolution to the B domain is how to get
Domain name can only be resolved to IP
------to solve the idea----------------------
Did you use a proxy?
------to solve the idea----------------------
I have an a domain name, resolved to the B domain name?
Don't understand
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.