Set default page to virtual directory in IIS 6

2

I have two applications, one of which is a store and is located under the virtual directory "store", while the main "application" is the parent website/application. However, when visiting the the top-level website address, I would like to start people in /store/default.aspx (technically "/store/home") but this is not allowed in the entry box in IIS.

Currently I am doing the redirect manually in code, but was wondering if there was a way to do this in IIS or something. Thanks for any help.

goldenratio

Posted 2009-12-16T02:45:43.340

Reputation: 141

Answers

2

one way to do this is (but not the most convenient way)...

Create a new .ASP page called start.asp and put the following in it:

<% response.redirect("http://mysite/store/default.aspx") %>

(Or the asp.net alternative) If you do not have classic ASP, then create start.htm with :

<HTML>
<HEAD>
<meta http-equiv="refresh" content="0;url=http://mysite/store/default.aspx" />
</HEAD>
</HTML>

And simply set up either start.asp, start.htm or whatever you want as the new default document.

Anyone who vists http://mysite will be redirected to http://mysite/store

Whilst this may not be the best way, if you want to redirect everyone from the main site to the store/default, this should work fine. To get back to the main application, you just need to type an absoloute path of the existing file such as http://mysite/default.htm

If you want anything more advanced, you may want to take a look at URL Rewriting (I am sure there is a better link to a ready to download module, but I can't find it.)... but this may be over kill for what you need.

William Hilsum

Posted 2009-12-16T02:45:43.340

Reputation: 111 572

1

When adding the default page entry in IIS remove the proceeding forward slash. You can set the default page in a sub directory like "store" The entry in the documents section of IIS for the default page should look like this "store/default.aspx". This has worked for me in IIS6 and 3.5 .net application.

Merc

Posted 2009-12-16T02:45:43.340

Reputation: 11

1

If you are asking if the default page for a folder can be a file outside that folder I think the answer is "no". I would redirect at the server side in ASP/ASPX, as opposed to a javascript/meta refresh redirect, as it will be almost as fast as if the option you required was possible.

sahmeepee

Posted 2009-12-16T02:45:43.340

Reputation: 1 589

It isn't outside the folder, it's just deeper in the directory structure (one level deeper). – goldenratio – 2011-01-12T22:56:18.880