I am new to MVC 4, so I need a little bit of more explaining when it comes to .config files.

So, I have a lab that requires me to create the fewest number of unique pages. With that, he also requires "www.cows.com" should map to the homepage.

I am stuck with this. I managed to get my host server to point at www.cows.com:82, but on launch of my MVC 4 application, I am directed to the IIS 7 page. No error, just the IIS 7 page. How do I get it to recognize my ActionResult methods inside my HomeController.cs?

A little background: To change my domain to cows, I had to go into IIS Manager, then Administration and create a new web site set to a different port than :80. Along with that, I had to configure my host.config AND the applicationhost.config. In my host.config I say: 82:www.cows.com and I say 127.0.0.1: www.cows.com (just to be sure) I believe that my problem has something to do with the configuration, because it doesn't hit my program, just directs me to the main IIS 7 page

Any ideas?

Thanks.

有帮助吗?

解决方案

I am not sure why you had to create your site on port 82 instead of the default 80. I don't remember exactly how the form looks like in IIS 7, but on IIS 8, you simply right click on Sites, Add Web site, give it a name, select the physical path of the site, then enter the host name (which would be www.cows.com for you ). You have to give the user IIS_IUSRS rights on your actual directory.

Then you go to your hosts (without any extension) file, inside /windows/System32/drivers/etc As an example, here is how mine looks like:

192.168.1.60    mono
192.168.1.60    mvc4test
192.168.1.30    aspinfo
127.0.0.1       aspinfo

There is not any other configuration to do for this to work.

Your site will be found by name, not by port number. You could, if you wanted to, but it's either/or, not both together.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top