Redirect from non www to www in WordPress using .htaccess
Do you need to redirect your traffic from http://yoururl.com
to http://www.yoururl.com
. If yes, then put below code in your .htaccess
file located in the WordPress Root Installation.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Now, you domain will be start redirecting from non www to www.