OK. I was finally able to find the issue. It can be reproduced it only on localhost and only in Visual Studio 2012 (not 2013). VS 2012 has some limitations when working with MVC 5. Seems that this routing issue is one of them.
So the solution is to just start using of VS 2013.
Here is a quick fix for this (the only problem is that link for the Administration will still have problem with inserted language code part)
This is method in LocalizedRoute.cs which appends extra language code before virtual path. Change is marked in bold.
/// <summary> /// Returns information about the URL that is associated with the route. /// </summary> /// <param name="requestContext">An object that encapsulates information about the requested route.</param> /// <param name="values">An object that contains the parameters for a route.</param> /// <returns> /// An object that contains information about the URL that is associated with the route. /// </returns> public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) { VirtualPathData data = base.GetVirtualPath(requestContext, values);
return data; //We return before extra language code part is added to URL. The remaining code will not execute.
Same problem here as well for version 3.30 (NopCommerce with source)
Using Windows 7 Prof Visual Studio 2012 Professional (using the ASP.NET development server)
In NopCommerce, after having set (under Localization Settings) SEO friendly URLs with multiple languages enabled and using url: http://localhost:15536
it redirects to: http://localhost:15536/en/
The link to (for example) HOME PAGE becomes:
http://localhost:15536/en/en/
and will result in a Page not found
(other links on the home page also contain double SEO codes)
I have defined two active languages (English and Dutch) For Language details I did set the Unique SEO code for the languages (en and nl in my case).
For now, I need to turn off SEO friendly URLs with multiple languages enabled but I hope that someone can tell how to make it work properly or explain why it does not work for at least some people...
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.