Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does my IIS virtual directory work with http://localhost but not http://computername?
    primarykey
    data
    text
    <p>I have been given the task of adding functionality to an existing IIS 6.0 website. To do it, I have built an ASP.NET MVC application. It works fine when deployed as it's own site, but doesn't seem to work when I try to deploy it as a virtual directory on the actual site where it needs to live.</p> <p>The server name is CWEBSERVER, and the IP is 192.168.1.11. From looking at IIS Manager, this is the site structure:</p> <pre><code>(Default Website) (root) - PRODUCTION (vDir) - CONTENT (not a vDir) - DATAFOLDER (vDir, contains MVC app, just added by me, not working) </code></pre> <p>The strange thing is that when I type the following URL's from a browser on the server it works:</p> <pre><code>http://localhost/DATAFOLDER/account.aspx http://127.0.0.1/DATAFOLDER/account.aspx http://192.168.1.11/DATAFOLDER/account.aspx </code></pre> <p>The following URL (which is the one that I NEED to work) doesn't:</p> <pre><code>http://CWEBSERVER/DATAFOLDER/account.aspx </code></pre> <p>The error I am getting is "The resource cannot be found."</p> <p>After looking closer, I realized that requests to <a href="http://CWEBSERVER" rel="noreferrer">http://CWEBSERVER</a> are going to the PRODUCTION vDir, but calls to <a href="http://localhost" rel="noreferrer">http://localhost</a> or <a href="http://192.168.1.11" rel="noreferrer">http://192.168.1.11</a> are going to the root of the website. I guess this is something setup by the original site designer. I am not sure how to change this setup, but I don't think I can change it anyway because there are actually a ton of other directories that would be affected. The other thing I wanted to point out is this: the CONTENT folder is accessible by going to <a href="http://CWEBSERVER/CONTENT" rel="noreferrer">http://CWEBSERVER/CONTENT</a>. This is really weird since I thought that the <a href="http://CWEBSERVER" rel="noreferrer">http://CWEBSERVER</a> pointed me to the root, so I wouldn't think that the "/CONTENT" would actually be able to get to the CONTENT folder.</p> <p>Now my problem is this: how do I get my DATAFOLDER accessible via <a href="http://CWEBSERVER/DATAFOLDER" rel="noreferrer">http://CWEBSERVER/DATAFOLDER</a>? I would think that I should just put the DATAFOLDER vDir <strong>inside</strong> of the PRODUCTION vDir. I tried it, and using the localhost or IP this is still accessible via:</p> <pre><code>http://localhost/PRODUCTION/DATAFOLDER/account.aspx http://127.0.0.1/PRODUCTION/DATAFOLDER/account.aspx http://192.168.1.11/PRODUCTION/DATAFOLDER/account.aspx </code></pre> <p>When I use CWEBSERVER, however, it still fails:</p> <pre><code>http://CWEBSERVER/DATAFOLDER/account.aspx </code></pre> <p>The error is still "The resource cannot be found.". Can anyone shed some light on this? Specifically, I have these questions:</p> <ol> <li>How does <a href="http://localhost" rel="noreferrer">http://localhost</a> go to the root, and <a href="http://CWEBSERVER" rel="noreferrer">http://CWEBSERVER</a> go to the PRODUCTION vDir? Where can I change this setting?</li> <li>Why would "<a href="http://localhost/PRODUCTION/DATAFOLDER/account.aspx" rel="noreferrer">http://localhost/PRODUCTION/DATAFOLDER/account.aspx</a>" work but not "<a href="http://CWEBSERVER/DATAFOLDER/account.aspx" rel="noreferrer">http://CWEBSERVER/DATAFOLDER/account.aspx</a>"?</li> </ol> <p>The accepted answer to this question (whom bounty will be awarded to) will need to be able to make it so I can access <a href="http://CWEBSERVER/DATAFOLDER/account.aspx" rel="noreferrer">http://CWEBSERVER/DATAFOLDER/account.aspx</a>. Thanks!</p>
    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.
 

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