I'm trying to redirect example.com/x/y/.. to https://sub.example.com/x/y/.. with following rules in my htaccess-file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^(.*)$ https://sub.example.com/$1 [L,R=301]
The redirect however does not add the sub-path of the original URL to the new one. So instead of redirecting to https://sub.example.com/x/y/.., I'm just redirected to https://sub.example.com
Any suggestions why?