I have a website which has canonical issues. I have already done the testing for it. when I open http://mywebsite.com it opens without redirecting it to http://www.mywebsite.com. Can someone give me exact code which I can add to my .htacess file to fix this issue. I want searchengines to recognize just the www.mywebsite.com version not the non-www version.
RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.com RewriteRule (.*) http://domain.com/$1 [R=301,L] ---- This should work, try this