To redirect your website from non-www to www, add the following lines in your website’s .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/\ [L,R=301]
Replace yourdomain.com with your actual domain name.