Hello,
my site is running Asp.net 2 on IIS 6 ( via third-party service provider).
I'm trying to secure a couple of folders in the root directory to be accessed only by the authenticated users. The rest of the site is to be available for everyone. I'm not using Roles, just Membership feature.
To accompish this, I included <location/> tags in my web.config.
But, but, but ... those directories are still accessible by everyone! Then I tried to place web.config in the sub-directories ( a shortened version as prescribed in the ealeir posts in this forum) ... but it still does not work.
Any ideas?
Here is files structure:
root/
root/family_albums/
root/trees/
Here is my web.config in the root dir:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
...
<system.web>
...
<authentication mode="Forms">
<forms name="AuthCookie" loginUrl="Login.aspx" defaultUrl="index.aspx" protection="All" timeout="30" path="/" />
</authentication>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<!-- deny access to non-members -->
<location path="trees">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<location path="family_albums">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
</configuration>
thanks !!!
sky_lion