I have a working Joomla 3.2 website and would like to direct all non www traffic to my www address.
I have tried to add the code below to my .htaccess file, which I presumed was working however it seems not. I implemented this code yesterday, the changes were not immediate - I checked this morning and my site was unavailable. As soon as I removed the code all was well again.
Am I doing something wrong? What would cause this issue?
# Redirect non-www urls to www
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
All help appreciated.