Till now I have been using htaccess to rewrite ?action only with this code:
RewriteCond %{QUERY_STRING} ^action=([^&\s]+)$
RewriteRule ^(?:index\.php|)$ /%1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\s\/]+)/?$ index.php?action=$1&r [L,QSA]
Now I dived into a multi language website and I would like to detect user´s browser language and based on this information redirect him to his language version
And to rewrite this:
index.php?lang=en&action=subpage
into
en/subpage