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

How do upload files to web space?

There are 2 methods available for doing this. The easiest and best method is to use a FTP client...

How to Redirect Non-WWW to WWW

The easiest way to redirect domain.com to www.domain.com on the url address bar whenever someone...

Disk space & Traffic

Disk Space Everything related to your Web site is stored on disk: your regular html files,...

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...

Running Scripts

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

Powered by WHMCompleteSolution