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?
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?
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
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.
Sounds fine then.
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.
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.
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.
Thank you for the support. It is cleaner after all to just show the domain.