25 Sep www redirect for main domains and subdomains – Semalt
If you want to redirect your main domain, or your addon domains with hostgator, or bluehost, or any other hosting provider with cpanel, then you can use this code in the particular .htacess file for that domain.
RewriteCond %HTTP_HOST !www.mynewwebsite.com$
RewriteRule .? http://www.mynewwebsite.com/$1 [L,R=301]