How to set ErrorDocument dynamically for different language
Hi,
In my current project, this is how we are setting ErrorDocument:
SetEnvIfNoCase Request_URI "^/(group|career|uk|se)/(en|sv)" MARKET=$1
SetEnvIfNoCase Request_URI "^/(group|career|uk|se)/(en|sv)" LANGUAGE=$2
# If market or language does not exists, they are set to default values
SetEnvIfNoCase MARKET ^\s*$ MARKET=group
SetEnvIfNoCase LANGUAGE ^\s*$ LANGUAGE=en
ErrorDocument 400 /%{ENV:MARKET}/%{ENV:LANGUAGE}/error-pages/4xx
ErrorDocument 401 /%{ENV:MARKET}/%{ENV:LANGUAGE}/error-pages/4xx
ErrorDocument 403 /%{ENV:MARKET}/%{ENV:LANGUAGE}/error-pages/4xx
ErrorDocument 404 /%{ENV:MARKET}/%{ENV:LANGUAGE}/error-pages/4xx
ErrorDocument 405 /%{ENV:MARKET}/%{ENV:LANGUAGE}/error-pages/4xx
And, its working fine. Now major concern is whenever a new market or new language in existing market is added, we need to change search criteria in dispatcher. Is there any way to dynamically populate the market and language in apache dispatcher config instead of using hard coded values?