Need to redirect the all sub-domains, except en.domain.com
to en.domain.com
Like
www.domain.com/en/ -> en.domain.com
www.domain.com/en/test -> en.domain.com/test
www.domain.com/en/dir/index.htm -> en.domain.com/dir/index.htm
domain.com/en/ -> en.domain.com
domain.com/en/test -> en.domain.com/test
domain.com/en/dir/index.htm -> en.domain.com/dir/index.htm
What is wrong with the following code?
RewriteEngine on
RewriteCond %{HTTP_HOST} !^en.* [NC]
RewriteRule ^/en/(.*) http://en.domain.net/$1 [L,R]