-1

greetings all, i have multi sub-domain on my domainname.com , i need to redirect www.*.domainname.com to *.domainname.com

ex: http://www.sub1.domainname.com to http://sub1.domainname.com

any ideas how to do so ?

Mahmoud Saleh
  • 33,303
  • 119
  • 337
  • 498

1 Answers1

0

Try this, and see does this help

RewriteCond  %{HTTP_HOST}  ^www.sub1.domainname.com
RewriteRule ^/(.*)         http://sub1.domainname.com/$1 [L,R=301]

Or try this for dynamic subdomain

RewriteCond  %{HTTP_HOST}  ^www.(.*).domainname.com
RewriteRule ^/(.*)         http://%1.domainname.com/$1 [L,R=301]
ajreal
  • 46,720
  • 11
  • 89
  • 119