http://example.com to http://www.example.com

Id you want to redirect the URL from http://example.com/ to http://www.example.com/ write below code in .htaccess file RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.example.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

Read More
'