title: htaccess redirect all subfolders/pages on one domain to matching subfolder on new domain (WordPress)
body: <p>I have a bunch of domains that all go to the same site and need to be able to redirect domainalias.com/folder/name to website.com/folder/name.</p>
  
  <p>I currently have the following htaccess which works as far as redirecting the root domain, but as soon as I go into a sub-directory or sub-page, it won't redirect:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  
  # BEGIN WordPress
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  # END WordPress
  
  # Redirect all domains to website.co.uk
  Options +FollowSymLinks
  RewriteCond %{HTTP_HOST} !^website.co.uk$ [NC]
  RewriteRule ^(.*)$ http://website.co.uk/$1 [L,R=301]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>So to confirm, I want people to be redirected from <a href="http://anydomainalias.co.uk/any/sub/folder" rel="nofollow">http://anydomainalias.co.uk/any/sub/folder</a> to <a href="http://website.co.uk/any/sub/folder" rel="nofollow">http://website.co.uk/any/sub/folder</a>. As it's a WordPress site, I need this to work dynamically. I have 50-odd subdomains so want to avoid having a rule for each one as well (hence the !^website.co.uk rule).</p>
  
  <p>Thanks.</p>