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.
The server name is CWEBSERVER, and the IP is 192.168.1.11. From looking at IIS Manager, this is the site structure:
(Default Website) (root)
- PRODUCTION (vDir)
- CONTENT (not a vDir)
- DATAFOLDER (vDir, contains MVC app, just added by me, not working)
The strange thing is that when I type the following URL's from a browser on the server it works:
http://localhost/DATAFOLDER/account.aspx
http://127.0.0.1/DATAFOLDER/account.aspx
http://192.168.1.11/DATAFOLDER/account.aspx
The following URL (which is the one that I NEED to work) doesn't:
http://CWEBSERVER/DATAFOLDER/account.aspx
The error I am getting is "The resource cannot be found."
After looking closer, I realized that requests to http://CWEBSERVER are going to the PRODUCTION vDir, but calls to http://localhost or http://192.168.1.11 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 http://CWEBSERVER/CONTENT. This is really weird since I thought that the http://CWEBSERVER pointed me to the root, so I wouldn't think that the "/CONTENT" would actually be able to get to the CONTENT folder.
Now my problem is this: how do I get my DATAFOLDER accessible via http://CWEBSERVER/DATAFOLDER? I would think that I should just put the DATAFOLDER vDir inside of the PRODUCTION vDir. I tried it, and using the localhost or IP this is still accessible via:
http://localhost/PRODUCTION/DATAFOLDER/account.aspx
http://127.0.0.1/PRODUCTION/DATAFOLDER/account.aspx
http://192.168.1.11/PRODUCTION/DATAFOLDER/account.aspx
When I use CWEBSERVER, however, it still fails:
http://CWEBSERVER/DATAFOLDER/account.aspx
The error is still "The resource cannot be found.". Can anyone shed some light on this? Specifically, I have these questions:
The accepted answer to this question (whom bounty will be awarded to) will need to be able to make it so I can access http://CWEBSERVER/DATAFOLDER/account.aspx. Thanks!
Most likely you have IIS bound to the IP address only. Go to IIS Manager, then go to properties on the website. Then, from the Web site tab, go to properties.
Add a identity for that host header value.
If necessary you can add multiple bindings.
update
I think I know what you want now. From IIS Manager, expand your default website. Then right click on the Production virtual directory and pick "Create Virtual Directory". Call this new one DATAFOLDER. Then tie this to the existing location on your file system.
I really think you need to clean this up a bit. The first thing I would do is decide how everything is really supposed to be accessed. In other words, when they type http://www.mysite.org/ What is that supposed to be? If it's the PRODUCTION directory, then Create a new site and point it to the PRODUCTION directory, then create your DATAFOLDER virtual app under it.