All the examples I see with RewriteRule are something like RewriteRule ^([a-z])$ index.php?example=$1
But I have the following case: I want the
example.com/en/something
to rewrite to
example.com/something?lang=en
And that applies to all things in the place of something. Basically I want to only take the first parameter if it's en or ru and rewrite to the same link but only to pass it as a get parameter
So
example.com/en/something-else/anything
also rewrites to
example.com/something-esle/anything?lang=en
How can I do that ?
UPDATE
I tried this RewriteRule ^(en|ru)/(.*)$ $2?lang=$1
but it says that the page is not found (it returns the 404 page from my application not from the server).