I'm working on a custom FriendlyURL analyzer for my cms (myprettycms.codeplex.com). The system is multilingual:
- http://www.mydomain.com/en-us/friendly/url/friendly_url_page.htm
- http://www.mydomain.com/fr-fr/friendly/url/friendly_url_page.htm
If you look in the file :
https://myprettycms.codeplex.com/SourceControl/changeset/view/19148#457568
it's the base class of 2 controllers. One is public and the other private. The difference between 2 code is Authorize decoration in the private one.
The login url depends on the language of the page you are trying to access.
If I'm on an English page like:
http://www.mydomain.com/en-us/products/priduct_list.htm
and if this page is private (the controller is set to DynaContentPrivateController) and if I'm not authenticated, the system will redirect my demand to the LoginURL defined in the web.config.
At this time, it's set to "~/logon"
I would have something like "~/{0}/logon" and know in witch part of the code I can override a code to replace {0} with the language of the page I was looking for.
Could you help me ?
I found the solution...
I kept the web.config setting :
Web.Config in codeplex
In the RouteConfig.cs
And in the languages routes loop in RouteConfig.cs
The routeconfig.cs in codeplex
In the controller base
_Controller_Base in codeplex
In the LogOn Controller in Security Layer
The LogOn controller in codeplex
So, when a user is redirected to LoginForm by standard role and membership (my Provider inherit standard one), controller analyse UrlRefer and add language to address and redirect to it.