how to modify .htaccess file to always redirect to www
snippet in htaccess

how to modify .htaccess file to always redirect to www

user5088

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

how to modify .htaccess file to always redirect to www

user4585

RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^(.*) http://www.example.com/$1 [R=301]