turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 155 forks source link

Disable default language URL #212

Closed tomasr78 closed 9 years ago

tomasr78 commented 9 years ago

I use i18n.UrlLocalizationScheme.Scheme2 schema to url tagging and default language tag is not added to web page url by default.

i18n.UrlLocalizer.UrlLocalizationScheme = i18n.UrlLocalizationScheme.Scheme2;

So the same web page content can be accessed from two different url like www.mydomain.com and www.mydomain.com/en. This is very harmful for web page ranking on search engines and I am looking how to disable default language url www.mydomain.com/en Do you have any ideas how to overcome this?

turquoiseowl commented 9 years ago

In Scheme2, any URLs to the default language (e.g. /en) in the page should be converted as part of Late URL localiztion to remove the langtag. Would you confirm whether or not this is the case with your app.

Further, any request URLs with the default language should be redirected to to a URL without the langtag when it arrives, as part or Early URL localization. My understanding of Google is that it will follow the redirect and cache the destination URL. Thus there is no duplicate URL as far as Google is concerned. Is that not right?

NB: there is a setting to control the type of redirect i18n does in this case:

i18n.LocalizedApplication.Current.PermanentRedirects
tomasr78 commented 9 years ago

In Scheme2, any URLs to the default language (e.g. /en) in the page should be converted as part of >Late URL localiztion to remove the langtag. Would you confirm whether or not this is the case with >your app.

turquoiseowl commented 9 years ago

?