Knowledgebase

Redirecting non www to www using .htaccess file

It is best practise to ensure you either use www or non www for your website but not both.  To ensure that you force search engines to look at only one you can easily use your .htaccess file which should be in your public_html directory in cPanel.  You simply need to add the follow code (statement) into your .htaccess file as follows.

Look for the following statement in your .htaccess file

RewriteBase /

If you do not have this, you can simply add it.

Then add the following statements just below the RewriteBase/ statement

RewriteCond %{HTTP_HOST} ^bigplans.co.nz$ [OR]
RewriteCond %{HTTP_HOST} ^www.bigplans.co.nz$
RewriteRule ^(.*)$ "http\:\/\/www\.bigplans\.co\.nz$1" [R=301,L]

 

REMEMBER TO REPLACE OUR DOMAIN DETAILS WITH YOUR OWN DOMAIN DETAILS

  • 56 Users Found This Useful
Was this answer helpful?

Related Articles

Guidelines to writing a blog or artiles on your website

There are a few guidelines to keep in mind when writing an article or blog for your website which...

What is Domain Authority?

MDomain Authority represents SEOmoz's best prediction about how a website will perform in search...

What is MozRank?

MozRank represents a link popularity score. It reflects the importance of any given web page on...

Opening a Google Analytics account

For those of you wanting to add Google Analytics to your website you will need to open a Google...

Speed up your website using htaccess caching

Here is a link to a website which explains how to use your .htaccess file to improve site speed...