Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp Default document not working on IIS7

I have a classic asp application inside a .NET 4.0 application. I have set the default document to login.asp, but it does not automatically redirect to it. The entire application functions fine though and even displays the login.asp correctly if I browse to it.

The default document section in web.config is as below:

<defaultDocument>
    <files>
        <clear />
        <add value="login.asp" />
        <add value="index.html" />
        <add value="default.aspx" />
        <add value="Default.htm" />
        <add value="Default.asp" />
        <add value="index.htm" />
        <add value="iisstart.htm" />
    </files>
</defaultDocument>

I have looked at other similar questions on this site but were not of much help.

like image 294
Shirlz Avatar asked Oct 04 '11 00:10

Shirlz


People also ask

How do I enable default files in IIS?

Right-click the Web site, virtual folder, or folder whose default document settings you want to configure, and then click Properties. Click the Documents tab. Click to select the Enable Default Document check box. This turns on default document handling for the Web site, virtual folder, or folder that you selected.


2 Answers

I finally found the issue was because the asp application was assigned to an app pool in classic mode using .NET Framework 4.0.

Once I changed the app pool to use .NET Framework 2.0 (with managed pipeline in classic mode), the default document started to work too!

like image 194
Shirlz Avatar answered Sep 22 '22 00:09

Shirlz


  1. Make sure you have Read/Write Feature Delegation enabled for Default Document: 1.jpg

  2. DefaultDocument does not redirect to the file (i.e. URL is not changed). It acts similar to Server.Transfer function — executes the file when root URL (http://sitename/) is requested. Probably, your login.asp executed but it has instructions to redirect logged-in users to a different page, or display the different content to them.

  3. Make sure the response is not cached. Clear cache and cookies and try again.

like image 32
Artem Koshelev Avatar answered Sep 19 '22 00:09

Artem Koshelev