How does one specify root location in web.config to allow unauthenticated users access it?
The root location is served by default.aspx, but users normally don't see default.aspx, they just see http://mysite.com/
.
So I've added
<location path="~/default.aspx"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location>
Which works if user hits mysite.com/default.aspx
, but if user hits mysite.com/
- he is still redirected to login page.
I've tried <location path="~">
(does not help) and also <location path="~/">
, <location path="">
(site fails completely) and could not make it work.
Any ideas?
Use the location element in the Web. To specify settings that apply to a specific application or directory, add the <location> element to the <configuration> element of an application Web. config file.
config is an XML file, it can consist of any valid XML tags, but the root element should always be <configuration> . Nested within this tag you can include various other tags to describe your settings.
The Web. Config file is used to configure Oracle Web Application functionality. This file is typically installed in the c:\Inetput\wwwroot\WebApp directory.
If Login. aspx form set to default form use to web. config file .
Try this one:
<system.web> <urlMappings enabled="true"> <add url="~/" mappedUrl="~/default.aspx" /> </urlMappings> <authorization> <allow roles="admin"/> <deny users="*" /> </authorization> </system.web> <location path="Default.aspx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With