Reputation: 728
We have a local instance of IIS 7 running with a website. Instead of the default "localhost" we have something like, mysite.compname.com
. This is a separate entry into IIS 7 and the default website was removed to prevent confusion.
Then in our host file we an entry like this:
127.0.0.1 mysite.compname.com
Now when I try to hit this url, http://127.0.0.1/ApplicationName/Project/AddProject.aspx
technically it should work, but instead I get a 404. I can vouch that this isn't a problem with the application, because if I navigate to http://mysite.compname.com/ApplicationName/Project/AddProject.aspx
it works fine.
My end goal is to be able to give someone my computer name, so that they can visit a test page, so the url above I think would get turned into this http://computername/ApplicationName/Project/AddProject.aspx
. Any help or at least links to understanding would help because I'm not sure where my issue is coming from.
Upvotes: 0
Views: 7294
Reputation: 19388
It sounds like the IIS site / application is configured using a Host Header.
This means that the site will only respond if the host
header sent by the browser matches the one configured for the site.
This is a standard method to allow one server to host sites for many host and domain names.
If you wish to allow others to view the site on your computer you will need to either have a local DNS server which you can edit, or, probably the easiest option, get them to edit their host files to include
<your IP> mysite.compname.com
.
Remember to open the requisite ports (probably only 80
, maybe 443
for https) in your firewall.
Or, you can try to edit the site config to remove or modify the Host Header requirement. See the first link for details, but be careful, it's easy to break things if you don't know the entire architecture of the site.
Upvotes: 1