2

So I published my webpage on a server and when I try to access it from a webbrowser I get the following error: HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

I'm pretty sure the problem is from my web.config file . Any help would be greatly appreciated :

<configuration>
  <system.web>
    <customErrors mode="Off"/>
    <authentication mode="Forms">
      <forms name=".ASPXFORUM" loginUrl="login.aspx" protection="All" timeout="30" path="/" />
    </authentication>
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>
</configuration>
hhh
  • 51
  • 4

3 Answers3

3

If you take out the <authentication> and <authorization> tags, do you still get it? If so, I'd look at the Default Document setting of your website, and make sure you have a default.aspx page (or whatever the title is that will line up to satisfy your Default Document).

Matt
  • 1,897
  • 4
  • 28
  • 49
  • Im new to asp.net . Is it necessary to have a default.aspx? The first page I want the user to access is login.aspx – hhh Mar 24 '11 at 23:54
  • You will need a default page of some sort. With your web.config settings, you're saying that nothing can be accessed without being authenticated anyway (due to your `` entry). See http://stackoverflow.com/questions/831994/why-is-deny-users-included-in-the-following-example If they aren't authenticated, they will automatically be redirected to login.aspx. If they are authenticated, they can see other pages. – Matt Mar 24 '11 at 23:59
2

add

   <system.webServer>
    <directoryBrowse enabled="true" />
   </system.webServer>

to your web.config in the configuration section.

http://blogs.iis.net/bills/archive/2008/03/24/how-to-enable-directory-browsing-with-iis7-web-config.aspx

Edit:

The above answer will remove the error, not solve your problem. This should fix it (if your set the name of your page instead of NameOfYourPage.aspx):

<system.webServer>
  <defaultDocument>
    <files>    
      <add value=”NameOfYourPage.aspx” />
    </files>
  </defaultDocument>
</system.webServer>
Martin
  • 5,954
  • 5
  • 30
  • 46
0

This looks like an IIS problem, could be one of the following:

1- is ASP.NET registered with IIS? check that you have other websites running under this IIS, and you can re-register ASP.NER with your IIS by doing this command from Visual Studio command line: aspnet_Regiis

2- have you selected the right .NET runtime from IIS?

this can be fixed by selecting the right version of App-pool for your website that matches your .NEt runtime version (most probably 2.0 and 4.0)

Mohammed Swillam
  • 9,119
  • 4
  • 36
  • 47