Skip to main content
added 30 characters in body
Source Link
Rizier123
  • 59.6k
  • 17
  • 104
  • 164

I have a local site: http://domain.loc/http://domain.loc/ and that site have subdomain: http://sub.domain.loc/http://sub.domain.loc/. How can I configure my ApacheApache server || PHPPHP to make him return global variable $_SERVER['REQUEST_URI']: $_SERVER['REQUEST_URI'] with my subdomain name ("sub" in this case)?

Examples: If

If I'll open the page http://domain.loc/http://domain.loc/ then $_SERVER['REQUEST_URI']$_SERVER['REQUEST_URI'] will be equal to '/'/
If I'll open the page http://sub.domain.loc/http://sub.domain.loc/ then $_SERVER['REQUEST_URI']$_SERVER['REQUEST_URI'] will be equal to '/sub/'/sub/

I have a local site: http://domain.loc/ and that site have subdomain http://sub.domain.loc/ How can I configure my Apache server || PHP to make him return global variable $_SERVER['REQUEST_URI'] with my subdomain name ("sub" in this case)?

Examples: If I'll open the page http://domain.loc/ then $_SERVER['REQUEST_URI'] will be equal to '/' If I'll open the page http://sub.domain.loc/ then $_SERVER['REQUEST_URI'] will be equal to '/sub/'

I have a local site: http://domain.loc/ and that site have subdomain: http://sub.domain.loc/. How can I configure my Apache server || PHP to make him return global variable: $_SERVER['REQUEST_URI'] with my subdomain name ("sub" in this case)?

Examples:

If I'll open the page http://domain.loc/ then $_SERVER['REQUEST_URI'] will be equal to /
If I'll open the page http://sub.domain.loc/ then $_SERVER['REQUEST_URI'] will be equal to /sub/

Source Link

Subdomain as part of REQUEST_URI

I have a local site: http://domain.loc/ and that site have subdomain http://sub.domain.loc/ How can I configure my Apache server || PHP to make him return global variable $_SERVER['REQUEST_URI'] with my subdomain name ("sub" in this case)?

Examples: If I'll open the page http://domain.loc/ then $_SERVER['REQUEST_URI'] will be equal to '/' If I'll open the page http://sub.domain.loc/ then $_SERVER['REQUEST_URI'] will be equal to '/sub/'