title: Apache rewriterule and rewritecond with 3 domains
body: <p>I have three domains (domain1.es, domain2.com, domain3.com).</p>
  
  <p>I need that:</p>
  
  <ul>
  <li><p>domain1.es OR www.domain1.es, show the content of www.domain1.es/catalog</p></li>
  <li><p>domain2.com OR www.domain2.com, redirect to www.domain1.es and show the content of www.domain1.es/catalog</p></li>
  <li><p>domain3.com OR www.domain3.com, shows the content of www.domain3.com</p></li>
  </ul>
  
  <p>I'm using cpanel, and I have the domain3.com like an aditional domain, configured to use the <code>/public_html/domain3.com</code> folder as web root folder.</p>
  
  <p>I've tried with the htaccess:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{THE_REQUEST} ^GET\ /catalog/
  RewriteRule ^catalog/(.*) /$1 [L,R=301]
  RewriteRule !^catalog/ catalog%{REQUEST_URI} [L]
  RewriteCond %{HTTP_HOST} ^domain2\.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.domain2\.com$
  RewriteRule ^/?$ "domain1\.es" [R=301,L]
  </code></pre>
  
  <p>All the domains are in the same hosting, with the root folder /public_html. Then</p>
  
  <ul>
  <li>www.domain1.es shows the content of <code>/public_html/catalog</code></li>
  <li>domain1.es shows the content of <code>/public_html/catalog</code></li>
  <li>www.domain2.com shows the content of <code>/public_html/catalog</code></li>
  <li>domain2.com shows the content of <code>/public_html/catalog</code> </li>
  </ul>
  
  <p>I am writing the domain3 rules, but I am not sure.</p>
  
  <p>Any idea?</p>