apekhsa
apekhsa

Reputation:

Setting Default URL in Web.Config for website

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

http://example.com 

and not:

http://example.com/default.aspx

How can I do that?

Upvotes: 3

Views: 40999

Answers (5)

Nabin Aryal
Nabin Aryal

Reputation: 1

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

Set the default page that you want to open on load

Upvotes: 0

Leonid Shirmanov
Leonid Shirmanov

Reputation: 59

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

Upvotes: 0

annakata
annakata

Reputation: 75794

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>

Upvotes: 1

Mladen Mihajlovic
Mladen Mihajlovic

Reputation: 6435

This is done from within IIS:

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

Upvotes: 11

Dimi Takis
Dimi Takis

Reputation: 4939

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

Upvotes: 0

Related Questions