Background
I have a little site that has been setup for our marketing team, it is configured on the same server as our core site. The site has been setup as marketing.lan
in Apache
. We have configured things so that any request made to our core site via the /marketing
url load the marketing.lan
pages. Example:
will point to the test.php
script on the marketing.lan
site. No redirection done, the browser URL will still be
www.coresite.com/marketing/test.php.
Apache is doing this by setting the host to marketing.lan for all request made via the 'www.coresite.com/marketing/' URL.
Problem
The problem is this, when I try and get the URL the page was accessed via using $_SERVER['HTTP_HOST']
I get marketing.lan/test.php
not www.coresite.com/marketing/test.php
, even with the browser showing the correct URL.
Question Is it possible to get the actual 'URL the script was accessed by? Or is this hidden by Apache? How would I do that.