i have a application who have hosted on currently on server testing. how i can check the domain where he goes hosted in the code ?
example.
testing.mydomain.com/
domain.com
how i can check that application goes hosted on subdomain or domain. i just want to know where he goes hosted.
you can use
HttpContext.Current.Request.Url.AbsoluteUri, that will return the complete path, from which you can compare it.Although it will fail, if user requested through IP. so the best option is in your hosted code, add a setting named BaseURL (in web.config), and set it appropriately.