I have published my MVC project to an an IIS 6 server. Running under the application MVCapp. The web project gets the url: www.domain.com/MVCapp/.
I use forms login for authentication and got an issue after publishing.
The web.config is as follows:
<authentication mode="Forms">
<forms name="CTWebCookie" loginUrl="~/Account/Login" defaultUrl="~/Home/Index" slidingExpiration="true" protection="All" timeout="20"/>
</authentication>
For example if I run the following code in an action:
FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
..everything works great and the user is redirected to www.domain.com/MVCapp/Account/Login.
However, when the authentication has timed out - at the next page request the user will be redirected to www.domain.com/Account/Login. The application root is not routed and the url points at the IIS root.
How can I make the application resolve the correct url after authorization timeout and why does it work when programamticly signing out not not when it automaticly signs out?
Please advice.