I know there are many topics. I tried them many times, but it doesn\'t work.
Instead of example.com/en/file.php, users see only
example.com/en/file.php
Perhaps something like this. Modify as you see fit for more specific pattern matching.
RewriteRule ^(?:(.*)/)?(.*)$ $2.php?lang=$1
Rewrites:
/en/fun => /fun.php?lang=en
/ru/fun => /fun.php?lang=ru
/fun => /fun.php?lang=