Recently I was working on a project and SEO team requested to add WWW forcefully in project URL. I asked why, they said.
“Must have www in your URL! Google Like it.”
So here is .htaccess snippet to force a url with WWW
When you will type http://phpmind.com it will automatically become http://www.phpmind.com
RewriteEngine on
rewritecond %{http_host} ^phpmind.com [nc]
rewriterule ^(.*)$ http://www.phpmind.com/$1 [r=301,nc]
This is how I did in this site. I am telling you one .htaccess secret. You can experience here only.
Thanks a lot, I was looking for a solution like this one!