[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

redirect Joomla sites to non www

Posted on 2011-03-14
2
Medium Priority
?
463 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
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…
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 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