Reputation: 1564
I have found several options how to properly localize my asp.net mvc project, but still have some doubts selecting the right one.
Want to mention that I need to localize site the way i would be still able to make SEO optimizations for each language separately
Here are the options i found:
First: create a subdomain for different culture:
mysite.com - for default language and
it.mysite.com - for italian language
Second: Create new route with subfolder querystring, like
mysite.com/default - for default language and
mysite.com/it/default - for italian language
There are no problems on implementing first option.
And if the second option is more preferable... could anyone describe how it should be implemented?
Upvotes: 0
Views: 383
Reputation: 12703
Depends what SEO effect you wanna achieve. But generally if all pages are on the same domain, it's better for SEO => mysite.com/it/default is better
Except if you have a real local business, then you could even go with different top level domains. E.g. mysite.de and mysite.it
In therms of MVC:
routes.MapRoute(
name: "Default",
url: "{languageCode}/{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
constraints: new { languageCode = @"de|fr|en|it" },
namespaces: new[] { "SupertextMvc.Controllers" } // only map routes to controllers in the specified namespace
);
This is our routing configuration
Upvotes: 1