Redirecting non www to www ONLY for domain, subdomain without www

Try:

RewriteEngine on
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{HTTP_HOST}   !^www\. [NC]
RewriteRule ^/(.*)         http://www.%{HTTP_HOST}/$1 [L,R=301]

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)