I have three domains (domain1.es, domain2.com, domain3.com).
I need that:
domain1.es OR www.domain1.es, show the content of www.domain1.es/catalog
domain2.com OR www.domain2.com, redirect to www.domain1.es and show the content of www.domain1.es/catalog
domain3.com OR www.domain3.com, shows the content of www.domain3.com
I'm using cpanel, and I have the domain3.com like an aditional domain, configured to use the /public_html/domain3.com
folder as web root folder.
I've tried with the htaccess:
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]
All the domains are in the same hosting, with the root folder /public_html. Then
- www.domain1.es shows the content of
/public_html/catalog
- domain1.es shows the content of
/public_html/catalog
- www.domain2.com shows the content of
/public_html/catalog
- domain2.com shows the content of
/public_html/catalog
I am writing the domain3 rules, but I am not sure.
Any idea?