I am trying to redirect http://example.com to http://www.example.com THe site is using wordpress and I can't find an existing htaccess file so I created a new one with the following code. I saved it in the root folder of the site. I am using hostgator with add on domains. But this throws the server in a loop that will never resolve. I am not sure if I have to find an existing htaccess file and add to it or this file is in the wrong place. Any help would be greatly appreciated. Thanks
Try RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] RewriteRule .* http://www.domain.com/ [L,R=301]
Thanks for the quick reply I copied it straight but still get an error. I think there may be an existing htaccess that is conflict but I can't find it using cpanel or my ftp client?