https://httpd.apache.org/docs/current/rewrite/intro.htmlRewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?lang=$1 [L,QSA]
%{REQUEST_FILENAME} The full local filesystem path to the file or script matching the request,
a '!' character (exclamation mark) to negate the result of the condition
-f Is regular file.
-d Is directory.
[PT] The target (or substitution string) in a RewriteRule is assumed to be a file path, by default. The use of the [PT] flag causes it to be treated as a URI instead.
[L] flag causes mod_rewrite to stop processing the rule set.
[QSA] When the replacement URI contains a query string, the default behavior of RewriteRule is to discard the existing query string, and replace it with the newly generated one. Using the [QSA] flag causes the query strings to be combined.