Setting Default URL in Web.Config for website

前端 未结 5 626
慢半拍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:30

    in IIS->your site->right click->property->Default Document

    Set the default page that you want to open on load

    0 讨论(0)
  • 2020-12-17 06:32

    It's possible (indeed encouraged) with IIS7, but the only way I'm aware of to do this in IIS6 is ugly urlmapping tricks:

    <system.web>
      <urlMappings>
        <add url="~/Default.aspx" mappedUrl="~/YourPage.aspx"/>
      </urlMappings>
    </system.web>
    
    0 讨论(0)
  • 2020-12-17 06:36

    This is done from within IIS:

    • From IIS 6
    • From IIS7
    • IIS 7 from web.config file

    You might also be able to do it by setting up some url mappings. Check here for more details.

    0 讨论(0)
  • 2020-12-17 06:38

    Either you set the default page in your IIS or inside your solution explorer by right-clicking and selecting "Set as start page".

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题