title: .htaccess redirect to subdomain
body: <p>I'm tying to set up the scenario, if someone visits <strong>website.com/blog/</strong> they are redirected to <strong>blog.website.com</strong>.</p>
  
  <p>I used this code in my .htaccess file to achieve some other redirection (from .net to .com) previously:</p>
  
  <pre><code>Options +FollowSymLinks
  RewriteEngine on  
  RewriteCond %{HTTP_HOST} ^(www.|blog.)?website.net(.*) [NC]  
  RewriteRule (.*) http://www.website.com/$1 [R=301,L]
  </code></pre>
  
  <p>It may also be relevant that I have an <strong>ErrorDocument 404</strong> in my apache configuration file.</p>
  
  <p>To solve my my problem I tried this:</p>
  
  <pre><code>Options +FollowSymLinks
  RewriteEngine on  
  RewriteCond %{HTTP_HOST} ^(www.|blog.)?website.net(.*) [NC]  
  RewriteRule (.*) http://www.website.com/$1 [R=301,L]
  
  RewriteCond %{HTTP_HOST} ^(www.)?website(.com|.net)/blog/?$ [NC]
  RewriteRule (.*) http://blog.website.com/ [L]
  </code></pre>
  
  <p>This code however is not working. My error document is still handling the request (the /blog/ directory doesn't exist). I tried moving this new code above the ErrorDocument in the apache conf file, but the same thing occurred.</p>
  
  <p>It's no doubt a syntactical error, any help would be greatly appreciated :)</p>