Hey there follow EE-ers. I have an htaccess question I hope you can help me with since it’s not my strongest area.
I have a site that’s just about ready to go live that is a multilingual MSM deployment. My question really only pertains to one site within the MSM structure, though i suspect the solution will be utilized on the others as well.
We’re using the multi-language alternative approach for EE2 as described in the Wiki. As outlined, we have a directory for each language and each containing a copy of index.php within which a user_language is defined, matching the language segment of en, fr, etc.
The trick is that in the root of the domain, in which one would find the original index.php, even if we define a language segment, that will add itself to all paths in EE - but if a user were to go into the address bar and remove said language segment, EE would still display the resulting page. Even with strict URL enforcement in EE, I’m not sue this is ideal. We would really want to force the server to apply a language segment in the event the language segment is removed from the URL - thereby preventing a whole host of 404 issues, not to mention Google potentially indexing the same content at the URLs with and without the language segment.
So my question is… can htaccess be used to automatically apply a language segment to the URL if the language segment is not detected?