How to Redirect Non-WWW to WWW URLs in Joomla

he Problem


When Search engines crawl your website they will consider http://bluebirdnet.ca and http://www.bluebirdnet.ca different websites. As a result, if your website has been linked to from other websites using the two URLs you are effectively splitting your potential to benefit valuable link popularity.

The Solution


Using a 301 redirect on the “non-www” version of the URL, this is essentially a “permanent” redirect in Hosting talk, you can easily consolidate all of your link popularity to one single URL. This consolidation will serve to increase your website’s chances of obtaining and maintaining top rankings.

Installing a Non-WWW 301 Redirect in Joomla


1. If you are not currently using .htaccess file for SEO purposes then first locate a file called htaccess.txt in your Joomla installation directory and rename file to ".htaccess".
2. Inside that file locate this section;

########## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
########## End - Custom redirects

3. Edit this file and add the following code and replace example.com with your own domain.


RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

4. Your end result should be this;

########## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#

RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

########## End - Custom redirects

5. Login to your Administrator panel in Joomla and go to Global Configuration and set "Use Apache mod_rewrite" to "Yes".

 

Now try refreshing your website and it should redirect to WWW.

 

Was this answer helpful?

 Print this Article

Also Read

What is the correct path for my Joomla logs ?

In the Global configurations under system you need to specify the full path to your log...

How to make Wordpress work with SSL/HTTPS

If you’re adding SSL to your existing site, then you need to move all your Wordpress files from...

Running Scripts

If you are having troubles with Perl CGI or PHP scripts please read the following...

Where is my Hosting Account Info?

When you sign-up for a Hosting account all your Hosting Account information is sent in an email....

Does your PHP installation include IonCube loaders?

Yes, these loaders are available with our PHP installations on all our servers.

Powered by WHMCompleteSolution