I have two web site sites on IIS 7 (Default, Custom). Both Sites host the same web application.
Some of the web application behavior changes depending under what web site it is running. Is there a way for the web application to find out what is the name of the WebSite under which it is handling the current request.
Thank you Imran
Use the ICANN Lookup tool to find your domain host. Go to lookup.icann.org. In the search field, enter your domain name and click Lookup. In the results page, scroll down to Registrar Information.
A domain name is a string of text that maps to a numeric IP address, used to access a website from client software. In plain English, a domain name is the text that a user types into a browser window to reach a particular website. For instance, the domain name for Google is 'google.com'.
Navigate to https://domains.google.com/registrar. Enter your preferred domain name in the search box. Review the search results to determine if the domain is available.
System.Web.Hosting.HostingEnvironment.SiteName
will get you the site name as it appears in IIS
Request.Url.Authority
will get yo the requesting url
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With