Resources: Code
Remove WWW from your URL
27 September 2012
Google recognises http://www.yourdomain.co.nz as a completely unique site from http://yourdomain.co.nz – so it makes sense (especially for search engine optimisation) to unify these urls.
Use this code in your .htaccess file to remove the www. Ensures search engines see the right site, and makes your url shorter! Boom!
RewriteCond %{HTTP_HOST} ^www.yourdomain\.co\.nz$ [NC]
RewriteRule ^(.*)$ http://yourdomain.co.nz/$1 [R=301,L]