hhh
hhh

Reputation: 51

Web.Config problem

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>

Upvotes: 2

Views: 1696

Answers (3)

Martin
Martin

Reputation: 6032

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>

Upvotes: 2

Mohammed Swillam
Mohammed Swillam

Reputation: 9242

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)

Upvotes: 0

Matt
Matt

Reputation: 1911

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).

Upvotes: 3

Related Questions