Htaccess redirect after changing Language URL format

In order to catch either lang=en or lang=ru you can change those directives like this:

RewriteCond %{QUERY_STRING} lang=(en|ru)
# exclude all requests starting with /wp-admin/
RewriteCond %{REQUEST_URI} !^/wp-admin/
RewriteRule (.*) /%1/$1? [L,R=302]

The (en|ru) part matches either en or ru and the surrounding parentheses make this a capturing group that can be referenced later.

The %1 (note the %, not $) in the RewriteRule substitution is a backreference to the captured group mentioned above. So, %1 holds either en or ru.

The trailing .*$ on the end of !^/wp-admin/.*$ is superfluous. As is the ^ prefix on the RewriteRule pattern (.*) – since regex is greedy by default.

Test first with a 302 (temporary) redirect and only change to 301 (permanent) when you are sure this is working OK – to avoid caching issues.

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino