Solved

redirect Joomla sites to non www

Posted on 2011-03-14
2
446 Views
Last Modified: 2012-06-27
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]
0
Comment
Question by:handsun123
2 Comments
 
LVL 4

Accepted Solution

by:
rjplus earned 500 total points
ID: 35136233
I think this should resolved your problem:

Enter the code below after the Rewrite Engine:on in the .htaccess file on the root of your website directory.

# non-www to www redirect
rewritecond %{http_host} ^ocalainsurance.com
rewriterule ^(.*)$ www.ocalainsurance.com/$1 [r=301,nc]
0
 

Author Comment

by:handsun123
ID: 35136576
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!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now