PHP Language Switch and HTACCESS

I’m making a bilingual website and have this link on each page:

echo "<a href=\\"".$_SERVER['PHP_SELF']."/?lang=ru\\">Switch to Russian</a>";

As you can see, it simply adds a $_GET variable to the end of the current URL. The current page then picks up that variable and switches to the appropriate language.

Additionally, I have the following mod_rewrite:

RewriteEngine On

Options -Indexes

RewriteCond &#37;{http_host} !^www\\.blah\\.com$ [nc]
RewriteRule ^(.*)$ http://www.blah.com/$1 [r=301,nc]

RewriteRule ^([A-Za-z0-9-]+)$ /$1/ [R]
RewriteRule ^([A-Za-z0-9-]+)/$ /$1.php

RewriteRule ^articles/([A-Za-z0-9-]+)$ articles/$1/ [R]
RewriteRule ^articles/([A-Za-z0-9-]+)/$ /article.php?id=$1

The article redirect (/articles/1/ to article.php?id=1) works fine. However, the language switch link doesn’t work on the article page. The above PHP would result in a link to: /articles/1/?lang=ru. Nothing happens when I click the language switch on an article page.

Without the mod_rewrite, I know linking to “article.php?id=1&lang=ru” would work, but how do I do it with the rewrite?

Thanks for any help.

Don’t use .htaccess (or the query string) for i18n. Use PHP’s __() or some similar function.

Thanks for the response, AlienDev. I googled “i18n in php” and found this tutorial, if anyone else is interested:

http://php-flp.sourceforge.net/getting_started_english.htm

In this case, however, since the site is already setup and this is the only thing nagging me, I would still be thankful if anyone can help me with the .htaccess fix.