This is because the Redirect
directive "connects" 2 path nodes, and you've got one inside the other (/sub/home
is inside /sub
). For example, if the directive looks like this:
Redirect 301 /a /b
This means when someone requests http://mysite.com/a/foo/bar
they get redirected to http://mysite.com/b/foo/bar
. What happens when you get redirected to /sub/home
is that you get redirected again because /sub/home
matches the pattern /sub
, and the home
gets appended, thus /sub/home?lang=enhome
.
You can try using RedirectMatch
instead, which doesn't "connect" path nodes:
RedirectMatch 301 ^/sub/?$ /sub/home?lang=en
Or mod_rewrite:
RewriteEngine On
RewriteRule ^/?sub/?$ /sub/home?lang=en [L,R=301,QSA]