My sites are in 4 languages and they are accessed with the following pattern:
http://example/index.php?lang=en
http://example/index.php?lang=es
http://example/index.php?lang=zh-tw
http://example/index.php?lang=zh-cn
I'm using the following mod_rewrite rule in my .htaccess file:
RewriteEngine on
RewriteRule ^([a-z]{2}(-[A-Z]{2})?)/(.*) $3?lang=$1 [L,QSA]
So typing http://example/en/index.php and http://example/es/index.php efectively redirects me to http://example/index.php?lang=en and http://example/index.php?lang=es respectively. But that doesn't work with http://example/index.php?lang=zh-tw and http://example/index.php?lang=zh-cn
It just says: The requested document was not found on this server.
It is something to do with the hyphen (zh-tw and zh-cn)?
How can I fix this problem?