I need to make a redirection in apache, so the user is redirected according to his/her browser language settings to the appropriate subdirectory, where the index.html file in the according language is stored. I use AliasMatch because I don`t want user to see the whole path for the webproject.
So I edited the httpd.conf with following 2 lines:
AliasMatch ^(?:/(?:en¦es¦fr¦ja¦ko¦ru))?(/.*)?$ "/usr/local/apache2/htdocs/MyProject/eng$1"
AliasMatch ^(?:/(?:de))?(/.*)?$ "/usr/local/apache2/htdocs/MyProject/de$1"
The problem is as following:
the apache doesn`t evaluate the second alias match. It redirects all requests to the english version, for all of the language settings.
I suppose, I should design the regular expression, so that apache woudn`t be able to execute the first AliasMatch in case the given language settings are not available.
Woulld you give me any hints, HOW I can achieve this?
Thanks for your help