apache - PHP get the user agent request URL -


background

I have a small site that is setup for us The marketing team has been configured on the same server as our core site. The site is set up in marketing.lan as Apache . We have configured things so that our core site is requested through the / marketing url marketing.lan to load pages. Example:

test.php will point to the script marketing.lan site. No redirection happened, browser URL is still going on

www.coresite.com/marketing/test.php

Apache is setting this setting ' Host for marketing for all requests made through www.coresite.com/marketing/ 'URL.

Problem

The problem is, when I try to URL and that page is $ _ server [http_HOST '] , then do not send me the message marketing.lan / test.php not www.coresite.com/companies/test.php , even if Also showing the correct URL with the browser.

Question Is it possible to get the actual URL? by? Or is it hidden by Apache? How can I go about doing this.

I understand:

  1. Both sites

  2. www.coresite.com is the same server (possibly, a Linux machine) documentRoot something like /var/www/coresite.com/

  3. Marketing.lan In a DocumentRoot something like /var/www/marketing.lan/

  4. Now you want marketing.lan as a sub-site of www.coresite.com , showing the content < Strong>


How to do this

There is no need to modify your personal Apache configuration; Just create a symlink .

  ln -s /var/www/marketing.lan/var/www/coresite.com/marketing  

This is your question will answer:

If your test.php is a line $ _SERVER ['HTTP_HOST'], resonate. $ _ SERVER ['REQUEST_URI'];

  • url going to http://www.coresite.com/marketing/test.php will show

    < P> www.coresite.com/marketing/test.php

  • Url http: // marketing Going to .lan / test.php

    marketing.lan / test.php

  • < / Ul>

Comments