Configure the default web page in IIS 7.5

I had a problem with HD on the machine where my Intranet IIS server was installed and I reinstalled all the software. I returned the site data to the new IIS, but now when I type the server address in the browser on the client or even the server computer, it does not find the page ("Default.aspx"). I can enable "Browse Directory" and click the file, but obviously I don't want this alternative without requiring users to type "Default.aspx" at the end of the URL.

This may be a very simple configuration, but I cannot find it in IIS.

+5
source share
4 answers

Place the following in a website or web.config application file:

<system.webServer>
    <defaultDocument>
        <files>
            <add value="~/Default.aspx"/>
        </files>
    </defaultDocument>
</system.webServer>
+4

- , IIS " ". IIS. , , "" "" .

+3

. .

  <system.webServer>
        <httpRedirect enabled="true" destination="/Pages/ABC/xyz/" childOnly="true" />
        <defaultDocument>
            <files>
                <add value="~/Default.aspx"/>
            </files>
        </defaultDocument>
  </system.webServer>
+2

MVC, default.aspx web.config

<system.webServer>
<defaultDocument enabled="true">
    <files>
        <clear />
        <add value="Default.aspx" />
    </files>
</defaultDocument>
</system.webServer>

Also added routes.IgnoreRoute ("") too; in RouteConfig.cs

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.IgnoreRoute("");
        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
    }

I followed the guide: http://weblog.west-wind.com/posts/2013/Aug/15/IIS-Default-Documents-vs-ASPNET-MVC-Routes

+1
source

All Articles