I want to redirect both of my domains (sharing the same document root) to the first, including anything trailing the domain name.
E.g.,
domainA.com => www.domainA.com
domainB.com => www.domainA.com
domainA.com/something => www.domainA.com/something
domainB.com/something => www.domainA.com/something
www.domainB.com => www.domainA.com
So in essence, my second domain is simply an alias for the first and I want to force www. I do not have access to the httpd.conf file.
Current httpd.conf (not working):
- Code: Select all
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domainA\.com$ [NC]
RewriteRule ^(.*) http://www.domainA\.com/$1 [R=301]