I have this Apache Rewrite rules:
RewriteCond %{QUERY_STRING} !lang
RewriteCond %{HTTP_HOST} ^(jp|en|kr|cn)\.example\.com
RewriteRule ^(.*)$ http://%1.example.com/$1&lang=%1 [L, QSA]
RewriteCond %{HTTP_HOST} ^(jp|en|kr|cn)\.example\.com
RewriteRule ^(.*)$ http://%1.example.com/$1?lang=%1 [L, QSA]
What I expected is
http://en.example.comtohttp://en.example.com?lang=enhttp://en.example.com/list.phptohttp://en.example.com/list.php?lang=enhttp://en.example.com/product.php?id=1tohttp://en.example.com/product.php?id=1&lang=en
(1) and (2) is fine, but what I got for (3) is
http://en.mobile-wifi_rental.local/product.php&lang=en?id=1.