<forms name="CompanyWeb" loginUrl="login.aspx" protection="All" path="/" />


M

Murphy

Our website contains subdirectories for each subsidiary company, each
company has it's own look and feel to the pages in their subdirectory
although they are all part of the main website.

The code below in the Web.Config file defines the authentication as forms
and the aspx file required for login if the user is unauthenticated... this
works well for the root level company web pages however when a user viewing
the website of SubCompanyA tries to access a secured page such as the
PasswordChange.aspx page as listed below they are always redirected back to
the login.aspx page at the root level. Instead I would like
SubCompanyA/PasswordChange.aspx to redirect the user to
SubCompanyA/login.aspx etc

Is this possible and how can I implement it ?

Thanks

Murphy

<authentication mode="Forms">
<forms name="CompanyWeb" loginUrl="login.aspx" protection="All" path="/"
/>
</authentication>


<location path="PasswordChange.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<location path="SubCompanyA/PasswordChange.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<location path="SubCompanyB/PasswordChange.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
 
Ad

Advertisements

P

Pete Beech

Could you, in the main login page, examine the GetRedirecUrl, and based on
that (i.e. if the URL is in SubCompanyA or SubCompanyB) redirect to the
appropriate login page. You'd have to preserve the query string with the
RedirectURL value, but I guess the FormsAuthentication methods would still
work. (However, I've never tried it.)

Pete Beech
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top