I am running a WP Blog with qtranslate. It allows me to create posts in multiple languages.
1 . Example URL without qtranslate:
2 . Example URL with localized content:
www.mysite.com/**en**/post1 (english - my default and fallback)
Unfortunately search engines etc. still remember my old links (1.) and these are still access-able. So "www.mysite.com/post1" now shows my english content without a redirect. But what it should do is to 301 users to "www.mysite.com/en/post1".
So now I would need a rule that basically checks if there is /en/post1 or a /de/post1 in the URL and otherwise redirect to the fallback /en/post1 URL. There is one exception because "/shop" is a real subdirectory and does not need to be preceeded by language information.
-- UPDATE --
I did it!!! That was actually fun but took me quite a while to figure out.
RewriteRule ^$ en [R=301,L]
RewriteRule ^([a-z]{2})/{1}$ $1 [R=301,L]
RewriteRule ^([a-zA-Z0-9\-\_]{3,})(/|$)$ en/$1 [R=301,L]
There are probably better ways to do this but it does the trick. Thanks everyone for the initial help!