简体   繁体   中英

IIS 7.5 default documents and ASP.Net MVC 2 Routes

I am trying to deploy a website on Win Server 2008 R2 machine with IIS 7.5. The website is developed with asp net mvc2. My client asked me to deploy a simple .html document to be served until we decide to go live with the mvc app. I have created the website and published my site for testing and it works perfectly, but I cannot make my application ignore the index.html page. Until now I have tried the following:

  1. added IgnoreRoute("index.html") to the Global.asax.cs of my application
  2. set the default document in IIS to be "index.html"
  3. removed all other files from default documents.

but I still cannot get it right.

This is actually a feature of MVC. If there is an actual document that can be found at the location, that document will be used instead of the MVC ActionResult. I'll see if I can dig up the documentation.

If your application is ready, why not just remove/rename the index.html?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM