Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes order of <location> in web.config matters?
    primarykey
    data
    text
    <p>I have set a FormAuthentication to my website.</p> <p>I want to allow annonymous access to the Login page and its resources (js, css, images).</p> <p>I have added to web.config. Does the order there matter?</p> <pre><code>&lt;configuration&gt; &lt;configSections&gt; &lt;section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" /&gt; &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&gt; &lt;/configSections&gt; &lt;appSettings&gt; &lt;add key="webpages:Version" value="1.0.0.0" /&gt; &lt;add key="ClientValidationEnabled" value="true" /&gt; &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt; &lt;/appSettings&gt; &lt;location path="~/Authentication.htm"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Resources"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/js"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Images"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Controllers"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; ..... &lt;/assemblies&gt; &lt;/compilation&gt; &lt;authentication mode="Forms"&gt; &lt;forms name="Login" loginUrl="~/Authentication.htm" protection="All" path="/" timeout="30" /&gt; &lt;/authentication&gt; &lt;authorization&gt; &lt;deny users ="?" /&gt; &lt;allow users = "*" /&gt; &lt;/authorization&gt; </code></pre> <p>Why do I still get authentication errors for the path I have added to the ?</p> <pre><code>Authentication.htm?ReturnUrl=%2fResources%2fScripts%2fjquery-1.7.1.min.js:1Uncaught SyntaxError: Unexpected token &lt; Authentication.htm?ReturnUrl=%2fjs%2fCommon.js:1Uncaught SyntaxError: Unexpected token &lt; Authentication.htm?ReturnUrl=%2fjs%2fAuthentication.js:1Uncaught SyntaxError: Unexpected token &lt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload