I am trying to host a MVC2 website to IIS.
Steps I have followed:
- Create a Website in IIS ( define directory defined physical path and app pool)
- Published code from visual studio to the physical path.
But when I tried to browse my site it was giving me error
HTTP Error 403.14 - Forbidden The Web server is configured to not list
the contents of this directory.
So, I enabled Directory Browsing feature, Now it only shows directory listing.
What I have tried?
- Added wildcard script map for aspnet_isapi.dll
- enabled HTTP Redirection
and some other things that I have found on some answers related to this question but nothing worked for me.
My routing configurations are
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…