Solved

redirect Joomla sites to non www

Posted on 2011-03-14
2
452 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Apache SSL and mod_rewrite not working 8 224
PHP in Apache server 20 105
Problem to get function 52 116
I need help developing an PHP application that browses for a file. 10 109
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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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