subdomains in PHP
Posted: Sun Oct 10, 2004 5:46 am
Hello
I am not sure if this question should be posted here, but since I am writing my application in PHP and I am sure someone here will know the answer, I will try. (in the worst case, please move this post somewhere else)
My application needs to perform certain actions if a subdomain was used in accessing the server.
For example, the URL http://dummy1.test.com should trigger a different behaviour than the URL http://www.test.com or http://test.com
Is there a way to obtain the subdomain part in the host without parsing it manually from the $_SERVER['HTTP_HOST'] value?
Also, can it be tested locally?
Usually when I debug my application I surf using http://localhost/
Is there a way to simulate a subdomain on the local machine?
regards
I am not sure if this question should be posted here, but since I am writing my application in PHP and I am sure someone here will know the answer, I will try. (in the worst case, please move this post somewhere else)
My application needs to perform certain actions if a subdomain was used in accessing the server.
For example, the URL http://dummy1.test.com should trigger a different behaviour than the URL http://www.test.com or http://test.com
Is there a way to obtain the subdomain part in the host without parsing it manually from the $_SERVER['HTTP_HOST'] value?
Also, can it be tested locally?
Usually when I debug my application I surf using http://localhost/
Is there a way to simulate a subdomain on the local machine?
regards