I have a domain (lets call it bar.com) and I want the default hostname to be foo.bar.com. So, bar.com would be redirected to foo.bar.com and foo.bar.com would correspond to the main httpdocs folder (I don't want my entire site to be in subdomains/foo/httpdocs, that's just plain ugly and redundant).
I've set foo.bar.com as an alias to bar.com in Plesk and that works fine. Then, to redirect bar.com to foo.bar.com I used an .htaccess with the following:
RewriteCond %{HTTP_HOST} ^foo\.bar\.com
RewriteRule ^(.*)$ http://foo.bar.com/$1 [R=301,L]
However, as you have probably figured by now, this results in a redirect loop.
Any ideas?