How can i redirect /?lang=en|ru to /?lang=en#googtrans(en|ru)? - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Wednesday, June 9, 2021

How can i redirect /?lang=en|ru to /?lang=en#googtrans(en|ru)?

How can I add the Google translate parameter #googtrans(en|de) or other language, so the translation happens automatically?

Basically, when the user goes to https://example.com/page/?lang=de they are redirected to https://example.com/page/?lang=en#googtrans(en|de)

I use this .htaccess rule, but it's not working:

RewriteCond %{QUERY_STRING} ^lang=([a-z]{2})$
RewriteRule ^/?lang=en#googtrans(en|[a-z]{2}) [R=301,L]


source https://stackoverflow.com/questions/67893159/how-can-i-redirect-lang-enru-to-lang-engoogtransenru

No comments:

Post a Comment