I need to grab just the domain name from the URL the user is requesting. I need to make sure the domain is only return since my application uses this info to differentiate different domain names pointing to the same web application. For example, if the URL is:
mydomain.com:8080
abc.mydomain.com?param1=123
xyz.mydomain.com:5000
I need all these to return "mydomain.com". What's the best way to do this?
mydomain.com:8080
abc.mydomain.com?param1=123
xyz.mydomain.com:5000
I need all these to return "mydomain.com". What's the best way to do this?