Click here to Skip to main content
15,880,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is My web.config Code:
XML
<httpRuntime targetFramework="4.5" maxRequestLength="102456" />
    <authentication mode="Forms">
      <forms  loginUrl="LogInUser.aspx" defaultUrl="home.aspx"  timeout="2880"/>
    </authentication>
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>


And this is my Problem:
http://localhost:2122/mywebsite.com/LogInUser.aspx?ReturnUrl=%2fmywebsite.com%2fhome.aspx
Posted
Comments
DamithSL 25-Oct-14 23:59pm    
what is the issue? I think it is normal behaviour.

Pretty simple: look at your web.config.
You deny all users any access - if this is in the root folder then any access will redirect to the login page.

The way authorisation is supposed to work is that the root folder is open access, and that allows the home and login pages to be accessed. Once logged in, users are redirected to other folders which have restricted access: you have to be logged in to load pages from them.
 
Share this answer
 
Comments
Member 11179892 26-Oct-14 6:21am    
Thank you sir, my problem is solved..
You can specify certain folders or paths in your application to be accessible by all users, specially when you are using windows forms authentication for instance, below is an example which grants access to all users on a certain page called register.aspx and the images folder:
HTML
<system.web>
	...
	...
	<location path="register.aspx"> 
		<system.web>
			<authorization>
				<allow users="*" /> // this will allow access to everyone to register.aspx
			</authorization>
		</system.web>
	</location>
	<location path="Images"> 
		<system.web>
			<authorization>
				<allow users="*" /> // this will allow access to everyone to Images folder
			</authorization>
		</system.web>
	</location>
</system.web>
 
Share this answer
 
Comments
Member 11179892 26-Oct-14 6:21am    
Thank you sir, my problem is solved...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900