-
web.config ARGHHHH!
ok I am trying to create a "Forms" authentication...
I have my root directory...
then I have a <root>/store/admin/ directory
I want users to be able to access the root aspx and the store aspx files but when someone goes to the <root>/store/admin/ folder I want Forms authentication to kick in!
I have the following web.config file located in the "root" folder:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<appSettings>
<removed for obvious reasons>
</appSettings>
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<location path="store/admin/">
<system.web>
<authentication mode="Forms">
<forms name=".myCookie" loginUrl="Login.aspx" protection="All" timeout="40" path="/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
</configuration>
I have also tried:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<appSettings>
<removed for obvious reasons>
</appSettings>
<system.web>
<authentication mode="Forms">
<forms name=".myCookie" loginUrl="Login.aspx" protection="All" timeout="40" path="/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
and I keep getting this error...
Code:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 17: <system.web>
Line 18:
Line 19: <authentication mode="Forms">
Line 20: <forms name=".myCookie" loginUrl="Login.aspx" protection="All" timeout="40" path="/"/>
Line 21: </authentication>
any idea what I am doing? sigh I am also using Plesk... :confused:
PLEASE HELP!
-
Re: web.config ARGHHHH!
put a web.config in your store dir
-
Re: web.config ARGHHHH!
I tried that... and got the same error... I assume its because the sub directory is not defined as an application directory - BUT - Im not sure how to do that...
Anjari
-
Re: web.config ARGHHHH!
I don't know then, never actual used forms authin....
-
Re: web.config ARGHHHH!
Try:
Code:
<system.web>
<authentication mode="Forms">
<forms name="F4D"
loginUrl="login.aspx"
protection="All">
</forms>
</authentication>
<authorization>
<allow users="*" />
</authorization>
</system.web>
<location path="store/admin">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
Give me a shout if it doesn't work.
DJ