.htaccess - htaccess lang prefix and query string -
i have htaccess add lang prefix on specific folder on files
htaccess rules
rewriterule ^fr/folder/(.*)$ /folder/$1?lang=1 [l] rewriterule ^en/folder/(.*)$ /folder/$1?lang=2 [l]
with above rules can redirect
/en/folder/myscript.php /folder/myscript.php?lang=1
and working fine.
now trying find way add query string if
for example
/en/folder/myscript.php?id=100 /folder/myscript.php?lang=1&id=100
i have try use code below no luck
rewritecond %{query_string} !^lang=1 rewriterule ^el/folder/(.*)$ /folder/$1?lang=1&%1 [l]
any appreciated.
have @ qsa flag.
if use
rewriterule ^fr/folder/(.*)$ /folder/$1?lang=1 [l, qsa] rewriterule ^en/folder/(.*)$ /folder/$1?lang=2 [l, qsa]
the query string shouldn't overwritten.
Comments
Post a Comment