title: How to 301 redirect an entire domain while preserving the path
body: <p>I am redirecting one domain to another, but I want to preserve the path in the redirect. So for example, I want to visit <code>www.example.com/services/education/page.html</code>, but my redirect will bring them to <code>www.new-example.com/services/education/page.html</code>. What do I write in my .htaccess file to preserve the path "/services/education/page.html"?</p>
  
  <p>Right now I have: </p>
  
  <pre><code>redirect 301 http://www.example.com/ http://www.new-example.com/
  </code></pre>
  
  <p>But I'm not sure if that works or not (Can't test yet as I am waiting for domain details etc). I just want to be sure when I put the site live. Is that right or am I way off base?</p>
  
  <p>Thanks!</p>