lonechicken
Programmer
How would I get the address that a user typed into the address bar when they visit my site? Why?
Say I have a site in which the DNS points multiple domains to the same ip address. Let's say both and both point to the same place. How would I detect which one the user typed in to get to that page?
This is so I can then redirect, say, site2.com users to a subfolder, but don't redirect mysite.com users. Some web hosts charge a certain small fee for forwarding a domain to a subfolder of another domain's site, while other hosts don't even let you do that much.
Say I have a site in which the DNS points multiple domains to the same ip address. Let's say both and both point to the same place. How would I detect which one the user typed in to get to that page?
This is so I can then redirect, say, site2.com users to a subfolder, but don't redirect mysite.com users. Some web hosts charge a certain small fee for forwarding a domain to a subfolder of another domain's site, while other hosts don't even let you do that much.