10

My question is really simple. I have a Web application with multiple sub-folders and there's no Default.aspx page in any of these.

How do I set the default page in each of these folders so users can type /folder instead of /folder/login.aspx?

Can this be done through the web.config file? Should I just rename the file in each folder to Default.aspx?

Thanks!

2 Answers 2

9

There is a default document section for web.config, and you can even put a web.config in each folder, and inside that config just have the default document set.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi Rusty. I wasn't able to make this work. I created a new Web.config file in each subfolder as mentioned in the link you provided but when I access /folder it shows directory listing. Maybe removing the web.config file in root folder? Anyway, I solved it through the IIS. I hadn't realized I could select Default Document for each folder. Thanks!
This solution didn't work for me either, I also got a directory listing.
as long as the default document name is the same in each folder (which it is for the OP) there's no need to do anything other than supply the default document name once and that will apply in every folder
2

There's a Default Document icon in the IIS section of your websites configuration panel. Open that up and you can add login.aspx to the list.

2 Comments

Thanks for the quick response antisanity. I checked this page: iis.net/ConfigReference/system.webServer/defaultDocument. However, the problem I have is there's no login.aspx in every folder. Meaning, that default file in every folder will not have the same name and in the Default Document section in IIS I can't choose default document for each folder. Let's say I have pageA.aspx and pageB.aspx in every folder, and in one of these folders pageA.aspx should be default, while in a different folder, pageB.aspx should be default? How can I achieve this? Thanks!!
Solved it! I hadn't realized I could select Default Document for each folder. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.