Results 1 to 5 of 5

Thread: web.config ARGHHHH!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

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

    PLEASE HELP!

  2. #2
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: web.config ARGHHHH!

    put a web.config in your store dir
    Magiaus

    If I helped give me some points.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    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

  4. #4
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: web.config ARGHHHH!

    I don't know then, never actual used forms authin....
    Magiaus

    If I helped give me some points.

  5. #5
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    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

    If I have been helpful please rate my post. If I haven't tell me!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width