title: .htaccess 301 redirect
body: <p>Does anyone know how can I do a 301 redirect traffic from one domain to the other - including all the same url elements after domain name - and apply the same rule to all possible links without writing it for each url separately - example would be something like this:</p>
  
  <pre><code>http://www.olddomain.com/catalogue/category/fruits/pg/2.html
  </code></pre>
  
  <p>to redirect to:</p>
  
  <pre><code>http://www.newdomain.com/catalogue/category/fruits/pg/2.html
  </code></pre>
  
  <p>At the moment I have something like this:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
  RewriteRule ^/?$ "http\:\/\/www\.newdomain\.com" [R=301,L]
  </code></pre>
  
  <p>but this won't work for the following situation for instance:</p>
  
  <pre><code>http://www.olddomain.com/login.html
  </code></pre>
  
  <p>it simply won't redirect to the new domain and keep the /login.html after.</p>
  
  <p>Any clues?</p>