.net - how can I restrict access to all files in a folder without web.config -


I need limited access to my administrator folder for some people who do not have an authentication ticket, Permitted page "should be redirected to How do I identify all the pages in my Admin folder? I have yet, but it's okay?

If url.Contains ("/ admin") then

'If the authentication ticket is incorrect then

  ` reaction. Redirect ("~ / notallowed_admin.aspx") ` 

end if

And no, for this particular problem, I would like to have my web Can not use config

Thank you very much

You should put security checks in global.assax

In addition to this, you will be wise to avoid mismatch, with a more accurate match by Rijks to change the location.

Protected Override Zero Application_BeginRequest (Object Sender, EventArgs e) {if (Regex.IsMatch (Request.Url.ToString (), @ ". * / System \ .aspx / admin. * \ .aspx ", RegexOptions.IgnoreCase)) {Response.Redirect (" ~ / AdminSecurityCheck.aspx "); Return; } .......}

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -