title: Redirect all traffic from one domain to another
body: <p>What I am trying to do is automatically redirect the domain for one of my sites</p>
  
  <p><code>www.domain1.com</code> to <code>www.domain2.co.uk</code></p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTP_HOST} ^www.domain1.com\. [NC]
  RewriteRule (.*) http://%www.domain2.com\%{REQUEST_URI} [R=301,NC,L]
  </code></pre>
  
  <p>I have looked over the site for the answer and the above is my code that I edited from another answer, but it doesn't work.</p>
  
  <p>I would like it in a .htaccess file - is this the best way of doing it?</p>
  
  <p>Thanks</p>