Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add location elements programmatically to the web config?

I have an application which creates page routes from a database. My whole site is secured with forms authentication but I need to allow unauthenticated uses to access these routes. I don't want to hard-code <location> tags for the routes in the web.config as this will negate me using a database to generate the routes.

Can anyone help?

like image 753
user489998 Avatar asked Oct 10 '11 15:10

user489998


1 Answers

Thanks everyone. I've found an answer here

Basically it involves creating a folder for each route and putting a web.config file in it allowing access. This approach needs to be coupled with setting RouteExistingFiles to false so that the routes don't get confused with the folders.

like image 73
user489998 Avatar answered Nov 15 '22 05:11

user489998