I can’t get the below redirection to work. It’s redirecting properly when I enter mydomin.com in the address bar, but not when I enter http://www.mydomain.com
I want all access from http://www.mydomain.com and mydomain.com to go to sub1.mydomain.com.
Note that I have sub2, sub3, they have their own .htaccess files and these should not be affected.
redirectMatch 301 ^www\.mydoman\.com$ http://sub1.mydomain.com
redirectMatch permanent ^www\.mydomain\.com$ http://sub1.mydomain.com
try this: