Link to home
Start Free TrialLog in
Avatar of handsun123
handsun123

asked on

redirect Joomla sites to non www

Help! In my panel at host gator there is an option to do redirects, which works great for my html sites, but the Joomla sites which already have an extensive  htaccess file will not redirect through the cpanel functionality. I need to modify the htaccess directly and have tried various code (I don't even know if it matters if it is at the top or the bottom of the htaccess file) this did not work, I had it at the bottom of the page, rewrite engine on is at the top: Thanks, Carin

I would like www to redirect to non-www

Options FollowSymlinks
rewritecond %{http_host} ^www.ocalainsurance.com [nc]
rewriterule ^(.*)$ http://ocalainsurance.com/$1 [r=301,nc]
ASKER CERTIFIED SOLUTION
Avatar of Robert Jackson
Robert Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of handsun123
handsun123

ASKER

I got this

The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

so then I found the exact redirect hostgator uses and put it directly under the Rewrite Engine:on and it works!

RewriteCond %{HTTP_HOST} ^www.ocalainsurance.com$
RewriteRule ^/?$ "http\:\/\/ocalainsurance\.com" [R=301,L]

I am redirecting to non-www.
 thank you!