Get current Domain URL in PHP I have my site on server http://www.myserver.uk.com For this i have two domain: http://one.com and http://two.com i would like get with PHP current domain, but if I use $_SERVER['HTTP_HOST'] then this show me myserver.uk.com instead of: one.com or two.com How can i get domain, not the server name? I have PHP version 5.2 Answer : try using this: $_SERVER['SERVER_NAME'] EDIT: apache_request_headers() or parse $_SERVER['REQUEST_URI']