| Localization filter. It's goal is to redirect or forward incoming unlocalized http requests (depending on the
choosen method, FORWARD or REDIRECT ) towards an address taking into account the best match
between requested locales and supported locales, and also to deduce the locale from URLS (when REDIRECT
is used).
Optional init parameters:
supported-locales : comma separated list of supported locales ; if not provided, there is an attempt to programatically determine it(1).
No default value provided.
default-locale : the locale to be used by default (after four checks: the incoming URI, the session, cookies, and the request headers).
No default value provided.
localization-method : forward or redirect , default is redirect .
match-host & rewrite-host : not yet implemented.(2)
match-uri & rewrite-uri : the regular expression against which an unlocalized uri is matched, and the replacement uri, where
@ represents the locale and $1, $2, ... the matched sub-patterns. Defaults are ^/(.*)$
for match-uri and /@/$1 for rewrite-uri.(2)
match-query-string & rewrite-query-string : not yet implemented.(2)
match-url & rewrite-url : not yet implemented.(2)
(1) for now, to find supported locales if this parameter is not provided,
the filter try to use the rewrite-uri param and to check for the existence of corresponding directories (only if the rewriting
string contains a pattern like '/@/', that is if you use directories to store localized sites).
(2) The different match- and rewrite- parameters pairs are mutually exclusive.
All matches are case-insensitive.
When the redirect method is used, these supplementary parameters (mutually exclusive) allow the filter to
know whether or not an incoming URI is localized.
inspect-host : not yet implemented.
inspect-uri : default is ^/(.+)(?:/|$) .
inspect-query-string : not yet implemented.
inspect-url : not yet implemented.
author: Claude Brisson |