To use this extension:
- Edit the MLServletHomePageRedirection.jsp in the wcm-multilocale.ear:
Update your HTTP Server. For example, if using IBM HTTP Server edit the following configuration settings:
- Comment out the lines in the getAvailableLocalesList method.
- Change s_defaultLocale to match the default locale.
- Add the following text to the end of the IBM HTTP Server configuration file:
LoadModule rewrite_module modules/mod_rewrite.so
RewriteRule ^/$ /wps/wcmml/jsp/html/MLServletHomePageRedirection.jsp [PT]
- For each locale in the s_availableLocales list, also add the following text to the end of the IBM HTTP Server configuration file:
RewriteRule ^/LOCALE$ /wps/wcm/connect/LIBRARY/SITE [PT]
- LOCALE: The string representation of the corresponding Java Locale object. For example, “fi” for Finnish and “pt_BR” for Brazilian Portuguese.
- LIBRARY: The web content library associated with the locale
- SITE: The top-level site area for the specified library
For example: RewriteRule ^/en$ /wps/wcm/connect/english/Internet [PT]
Important: Never map any of the locale redirections to the main domain.
How it works
Every time you request the top-level domain the locale of the current user, or the ordered list of preferred languages set in the browser, is checked against the list of available locales as in the JSP. The JSP then redirects back to the top-level domain plus the available locale, and the web server then redirects to the correct content item based on that locale.
While this extension is designed for servlet-rendering, it can be used with portlet-rendering to render different locales from different servers.
Parent topic: Extensions for multilingual sites