Last post Mar 09, 2017 11:37 AM by acmedeepak
Mar 08, 2017 08:13 AM|acmedeepak|LINK
I have IIS7. I am working on .NET 4.5. I need to deploy a website where all the pages are in sub folders(not in root folder). In this situation, How can I set the Default document. All my pages are segregated into sub folders as per their necessity. Please
help me in this.
My aspx page which needs to be default page is at
How can I make this the default page.
Mar 08, 2017 08:26 AM|PatriceSc|LINK
Crerating a web.config in this folder to define the default document should work: https://www.iis.net/configreference/system.webserver/defaultdocument
My personal preference would be likely to just name the page default.aspx . Depending on why you have done this you could also have a look at https://www.iis.net/configreference/system.webserver/defaultdocument which would allow to use /transactions and serve
the transactions.aspx page (if this is what you are trying to achieve)
Mar 09, 2017 02:17 AM|Chris Zhao|LINK
To redirect from root to subdirectory.
<rule name="Root Hit Redirect" stopProcessing="true">
<match url="^$" />
<action type="Rewrite" url="/Transactions/FirstPage.aspx" />
Mar 09, 2017 06:54 AM|acmedeepak|LINK
Should I do this in the root web.config file or as PatriceSc says, Should it be in the sub directory web.config. Please let e know
Mar 09, 2017 11:35 AM|PatriceSc|LINK
This is not the same approach. One is to change the default document inside this particular folder. The other one is to redirect / http queries to this page.
As I pointed also :
- if using default.aspx it would just work
- I suspect that you are doing that in an attempt to have "clean" urls. You could then try http://stackoverflow.com/questions/14116477/asp-net-webforms-extensionless-urls and
use pages in the root directory.
For now my understanding is that each page is in its own folder maybe because you wanted to take part of default document to achieve a similar result ???
Mar 09, 2017 11:37 AM|acmedeepak|LINK
I understand what you said. As a new guy to these things I didn't understand in the beginning. Thanks by the way.