I have a site where I want to allow different groups access certain areas.
I have my main web.config, and a web.config in the subdirectory that I want to redirect to a login page.
This is my Main web.config
This works fine. It forces anyone wanting to go to an admin directory to the adminlogin.aspx page(line 5). If they want to go to the Site directory(line 15), they have full access without having to sign in.
However, I have a Members directory inside of Site. I dropped a web.config into the Members directory.
This works fine too, except it redirects to the adminlogin.aspx page instead of a memberslogin.aspx page. Where can I put code that will redirect anyone trying to access the members directory to memberslogin.aspx as opposed to adminlogin.aspx?
Thanks for the help.
Chad
I have my main web.config, and a web.config in the subdirectory that I want to redirect to a login page.
This is my Main web.config
Code:
1<system.web>
2
3<authentication mode="Forms">
4 <forms name="yourAuthCookie"
5 loginUrl="administrator/adminlogin.aspx"
6 protection="All" path="/" />
7</authentication>
8
9<authorization>
10 <deny users="?" />
11</authorization>
12
13 </system.web>
14
15 <location path="Site">
16 <system.web>
17 <authorization>
18 <allow users="?" />
19 </authorization>
20 </system.web>
21 </location>
This works fine. It forces anyone wanting to go to an admin directory to the adminlogin.aspx page(line 5). If they want to go to the Site directory(line 15), they have full access without having to sign in.
However, I have a Members directory inside of Site. I dropped a web.config into the Members directory.
Code:
1 <system.web>
2
3<authorization>
4 <deny users="?" />
5 <allow users="*" />
6</authorization>
7
8 </system.web>
This works fine too, except it redirects to the adminlogin.aspx page instead of a memberslogin.aspx page. Where can I put code that will redirect anyone trying to access the members directory to memberslogin.aspx as opposed to adminlogin.aspx?
Thanks for the help.
Chad