How do I set the default page of my application in IIS7?

前端 未结 7 1013
北荒
北荒 2020-11-29 02:41

I deployed my web application to IIS7 and everything works just fine. However, instead of typing the url of my true starting page, I want it to automatically go to www.xxxxx

相关标签:
7条回答
  • 2020-11-29 03:20

    Just go to web.config file and add following

    <system.webServer>
        <defaultDocument>
          <files>
            <clear />
            <add value="Path of your Page" />
          </files>
        </defaultDocument>
    </system.webServer>
    
    0 讨论(0)
  • 2020-11-29 03:21

    For those who are newbie like me, Open IIS, expand your server name, choose sites, click on your website. On new install, it is Default web site. Click it. On the right side you have Default document option. Double click it. You will see default.htm, default.asp, index.htm etc.. to the extreme right click add. Enter the full name of your file(including extension) that you want to set it as default. click ok. Open cmd prompt as admin and reset iis. Remove all files from c:\inetpub\wwwroot folder like iisstart.html, index.html etc.

    Note: This will automatically create web.config file in your c:\inetpub\wwwroot folder. I didnt have any web.config files in my inetpub or wwwroot folders. This automatically created one for me.

    Next time when you enter http(s)://servername, it opens the default page you set.

    0 讨论(0)
  • 2020-11-29 03:23
    1. On IIS Manager select your page in the Sites tree.
    2. Double click on configuration editor.
    3. Select system.webServer/defaultDocument in the drop-down.
    4. Change the "default.aspx" to the name of your document.
    0 讨论(0)
  • 2020-11-29 03:23

    Karan has posted the answer but that didn't work for me. So, I am posting what worked for me. If that didn't work then user can try this

    <configuration> 
        <system.webServer> 
            <defaultDocument enabled="true"> 
                <files> 
                    <add value="myFile.aspx" /> 
                </files> 
            </defaultDocument> 
        </system.webServer>
    </configuration> 
    
    0 讨论(0)
  • 2020-11-29 03:35

    On IIS Manager--> Http view--> double click on Default and write the name of your desired startup page, Thats it

    0 讨论(0)
  • 2020-11-29 03:37

    I was trying do the same of making a particular file my default page, instead of directory structure. So in IIS server I had to go to Default Document, add the page that I want to make as default and at the same time, go to the Web.config file and update the defaultDocument header with "enabled=true". This worked for me. Hopefully it helps.

    0 讨论(0)
提交回复
热议问题