To redirect your domain from http://mydomain.com to http://www.mydomain.com, add the following code to your .htaccess file:

RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
RewriteRule ^(.?)$ http://www.mydomain.com/$1 [R=301,L]
Was this answer helpful? 1 Users Found This Useful (2 Votes)