title: Redirect variable page to variable subdomain wildcard
body: <p>I am stuck on the follow htaccess situation.</p>
  
  <p>I want to redirect pages to subdomains.</p>
  
  <p>Url example right now;</p>
  
  <p><a href="http://domain.tld/user/foo" rel="nofollow">http://domain.tld/user/foo</a></p>
  
  <p>I need to redirect this to;</p>
  
  <p><a href="http://foo.domain.tld" rel="nofollow">http://foo.domain.tld</a></p>
  
  <p>The subdomain is genereated by wildcard.</p>
  
  <p>I tried the follow without succes;</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} !^(www\.)?domain\.tld [NC]
  RewriteCond %{HTTP_HOST} ^(.*)\.domain\.tld?$
  RewriteRule (.*) s/index.php?user=%1 [NC,QSA] 
  RewriteRule ^user/(.*) (.*) [R=301,L]
  </code></pre>
  
  <p>Regards,</p>
  
  <p>Nick</p>