Solved

redirect Joomla sites to non www

Posted on 2011-03-14
2
443 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

24 Experts available now in Live!

Get 1:1 Help Now