London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Homepage language as first segment

Vote:
 

I have a website supporting multiple languages as translation of the pages. An example of a URL is www.websitedomain.com/en/somepage. Somehow the homepage doesn't have a language segment by default. The page can be reached under www.websitedomain.com/ and www.websitedomain.com/en/. I want to make a FriendlyUrlRewriteProvider that will rewrite the URL with the homepage language.

Is the FriendlyUrlRewriteProvider still the way to go in Episerver 9 or do I need another solution?

#172431
Dec 02, 2016 13:39
Vote:
 

The default routing will use www.websitedomain.com/en/somepage (with language tag) for all language EXCEPT if you have set default culture on host. Hint: you do this in admin where you also specify site url and http/https.

If you have set this to "en" then language segment will be skipped on that host and you will get www.websitedomain.com/somepage for "en" language. Removing default culture on host will probably work? 

#172432
Edited, Dec 02, 2016 14:18
Vote:
 

I've not added a culture in the admin settings. The homepage is not using a language in the segment. Maybe its not a problem after all because a canonical is rendered in the homepage that is telling to index the www.websitedomain.com/en instead of www.websitedomain.com

#172434
Dec 02, 2016 16:07
Vote:
 

If you render a canonical link you should be fine. It's actually better to just do that, otherwise you have to redirect users to e.g. /en/ which is way worse performance-wise.

#172443
Dec 02, 2016 17:54
Vote:
 

Sounds fine then.

#172458
Dec 03, 2016 18:53
Vote:
 

IIS URL Rewrite module can be used for redirection to avoid performance issues. (still an extra trip)
Cannonical URLs will be enough for SEO purposes.

Regards
/K

#172471
Dec 04, 2016 21:48
Vote:
 

I was not referring to server performance though. It's annoying to be redirected when you're on your mobile or slow connection in general, when there's no need for it.

#172472
Dec 04, 2016 23:15
Vote:
 

You can try to take a look at the description of "Strict language routing" that was introduced in version 7.5. See one of the last paragraphs of this page: http://world.episerver.com/blogs/Johan-Bjornfot/Dates1/2013/12/Routing-changes-in-75/

It contains a short description of language routing.

#172490
Dec 05, 2016 11:25
Vote:
 

Thank you for the support. It is cleaner after all to just show the domain.

#172748
Dec 09, 2016 17:25
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.