I'm having troubles writing a seemingly easy RewriteRule/Condition:
example.com
should redirect to example.com/de
.
example.com/de
shouldn't redirect.
example.com/en
shouldn't redirect.
example.com/foobar
should redirect to example.com/de/foobar
.
example.com/de/foobar
shouldn't redirect.
example.com/en/foobar
shouldn't redirect.
What I have is this:
RewriteCond %{REQUEST_URI} !^\/(de|en)/(.*) [NC]
RewriteRule ^ http%{ENV:protossl}://%{HTTP_HOST}/de%{REQUEST_URI} [L,R=301]
But I always get too many redirects.