Skip to content
Oct 22 / kkrizka

How To Setup No WWW Redirection

The NO-WWW redirection allows you to redirect any visitors that stumble on to, or vice versa. This is very important for any website, because it improves the search ranking of all your pages . Since your ranking is determined by the number of inbound links to your site, it is important that for high ranking your pages have as much inbound links as possible. However by default, only half the links are counted in the search rank calculation because as far as the computerized crawlers knows, you are running two different websites at and Luckily the NO-WWW redirection fixes this problem, and it takes only a few seconds to setup.

The simple NO-WWW redirection requires that your web host has the Apache mod_rewrite module enabled. This module is very common, so it is quite probable that everything you need is there. All you have to do now is create a new file named .htaccess in the folder that holds the top of your web page files (usually called www or public_html), and add the following code at the end of it:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

Of course don’t forget to change to your domain, because otherwise I might be getting quite a lot of traffic. 😉 From now on when a visitor or a spider gets to your web page via, he will be automatically redirected to You only need to add this to top folder of your webpage, because the rules in the .htaccess file are recursively applied to all folders.

Leave a comment