Setting Default URL in Web.Config for website

前端 未结 5 637
慢半拍i
慢半拍i 2020-12-17 05:49

When users navigate to my site, I want it to display :

http://example.com 

and not:

http://example.com/default.aspx
         


        
5条回答
  •  鱼传尺愫
    2020-12-17 06:48

    If you run your web site under IIS just launch IIS manager in Windows, then open your site in a tree and double click on Default documents icon. In opened window make sure that index.aspx setting exists, if doesn't put it in and move it up to the first one in a list.

    Also there is a way to set up the default document via admin script (vbscript) like this:

    set node=getObject("IIS://LocalHost/W3SVC/1/Root")
    node.defaultdoc = "index.aspx" & "," & node.defaultdoc
    node.setinfo
    

提交回复
热议问题