Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find Website Name from a web application

Tags:

asp.net

iis

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

like image 839
imasud Avatar asked Aug 31 '10 19:08

imasud


People also ask

How do you find the domain name of a website?

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.

What is domain in web application?

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'.

How do I find out if a domain name is available?

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.


1 Answers

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

like image 95
Sruly Avatar answered Sep 25 '22 16:09

Sruly