Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The following is limited to my experience so . . . YMMV</p> <p>I do not believe that there is a true default location.<br> IIS will host a site in any folder that IIS has access permissions for. To determine what folder that might be, you can query the existing site list.</p> <hr> <p><strong>BUT</strong> </p> <p>All is not lost. You can figure out where those sites are!</p> <p>In a new IIS installation you can locate the directory of the "Default Site" created during the IIS installation.</p> <p><em>Just keep in mind that there are no guarentees that the site will remain there. Personally, I delete the Default Site as soon as I start to configure IIS.</em></p> <hr> <p><strong>In IIS 7+</strong> </p> <p>Site locations can be found in an XML file under IIS's configuration folder.</p> <p>%systemroot%\System32\inetsrv\config\</p> <p>In the XML file applicationHost.config see </p> <p>The XML Node path is: /configuration/system.applicationHost/sites/</p> <p>From there you can iterate through each child node to see the various folder locations. For example, the default site will probably be listed as:</p> <pre><code>child node: site name="Default Web Site" id="1" </code></pre> <hr> <p>The .Net Way</p> <p>Another trick would be to query IIS directly via .Net.</p> <p><a href="http://www.iis.net/learn/manage/scripting/how-to-use-microsoftwebadministration" rel="nofollow">Here is the API documentation</a></p> <p>Here are some methods to keep in your back pocket: </p> <pre><code> private static Site GetSite(string siteName) { Site site = (from s in (new ServerManager().Sites) where s.Name == siteName select s).FirstOrDefault(); if (site == null) throw new Exception("The Web Site Name \"" + siteName + "\" could not be found in IIS!"); return site; } private static ApplicationCollection GetApplications(Site site) { //HttpContext.Current.Trace.Warn("Site ID3: " + site + "/n"); ApplicationCollection appColl = site.Applications; return appColl; } private static String GetHostName(Site site) { BindingCollection bindings = site.Bindings; String bind = null; foreach (Binding binding in bindings) if (binding.Host != null) return binding.ToString(); return bind; } </code></pre> <hr> <p><strong>Update!</strong> While I can't guarantee that this location will remain after install, you can also <a href="http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.getvalue.aspx" rel="nofollow">query the registry</a>:</p> <p>Check out HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\InetStp\pathWWWRoot\</p> <hr>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload