Add the following to your .htaccess file to force the WWW. at the beginning of the URL.

# Rewrite example.com → www.example.com 
# Use with caution, as this may cause subdomains to forward as well. 
<IfModule mod_rewrite.c> 
RewriteCond %{HTTPS} !=on 
RewriteCond %{HTTP_HOST} !^www..+$ [NC] 
RewriteCond %{HTTP_HOST} !=localhost [NC] 
RewriteCond %{HTTP_HOST} !=127.0.0.1 
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 
</IfModule>