简体   繁体   中英

Finding root directory in web.config file

I'm trying to find the root directory of my aspx application. The scenario is a user is trying to login to a subfolder of my root. I want them to be redirected to a login page inside of another folder.

I'm trying to handle this inside of the root web.config file, but the compiler is looking inside of the subfolder from which the user is trying to login from.

<authentication mode="Forms" >
      <forms loginUrl="~/auth/login.aspx" name="loginform">
      </forms>
    </authentication>

is the directory i'm trying to get to but it is still looking inside of the app folder, not the root directory.

Here is what i am getting

/Apps/subfolder/auth/login.aspx

and this is what i want

/Apps/auth/login.aspx

keep in mind that /Apps/ is the root directory.

Thanks for the help guys

This value is being superceded by a value elsewhere in the code. Maybe the web.config in the subdirectory where the page the user tries to view before being sent to login is held.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM