I've got a website run by WordPress MU. The leading page from the website is converted in a number of languages. How do you rewrite the next Web addresses?

http://www.example.com/?lang=en
http://www.example.com/?lang=fr

to:

http://www.example.com/en/
http://www.example.com/fr/

This really is my current .htaccess,

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# Uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress

I haven't examined so I'm not one hundred percent confident that it really works but which should provide you with ideas.

I advice you to definitely have a look in the documentation of mod-rewrite.

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

#languages
RewriteRule ^/(en|fr)/(.*)$ /$2?lang=$1

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress

This can redirect and preserve the initial query string:

RewriteCond %{QUERY_STRING} (.+)
RewriteRule ^([a-z]{2}) /?lang=$1&%1 [L]

RewriteRule ^([a-z]{2}) /?lang=$1 [L]
RewriteEngine On
RewriteBase /

RewriteRule ^en  /?lang=en
RewriteRule ^fr  /?lang=fr