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/
.htaccess
is not ok for you?$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']
instead of only the uri? See PHP: $_SERVER - Manual.