Non Www version not Redirecting to Www version in WordPress [Solution]

We all know that WordPress is a SEO friendly Blogging platform . One thing which WordPress takes care of intelligently is by directing non www to Www version or vice versa, depending upon your settings under general tab.

I have my settings set to direct non www version of site to Www & this happens automatically. (WordPress handles it).


Now here is a bug which I have spotted couple of days back that after updating my blog to latest 3.1, non www version of site is not redirecting to Www version. This seems like a big issue when we consider SEO.

After little bit of hit and trial, I realize issue is with my cache plugin (W3 total cache). If I disable caching, WordPress handles this redirection else on activation of cache plugin, it fails. Finally I landed into this thread from WordPress forum and found the solution.

If you happen to fall in the same situation, simply move your WordPress redirects above the codes added by W3 total cache in your .htaccess file.

Your redirection code will be something like this:

   1: # BEGIN WordPress

   2: <IfModule mod_rewrite.c>

   3: RewriteEngine On

   4: RewriteBase /

   5: RewriteCond %{REQUEST_FILENAME} !-f

   6: RewriteCond %{REQUEST_FILENAME} !-d

   7: RewriteRule . /index.php [L]

   8: </IfModule>


  10: # END WordPress

Once you have moved your code above code added by W3 total cache, clear your cache and check if redirection is happening or not. If everything seems to be fine, it’s time to grab a coffee. :)

If you are using W3 total cache plugin, don’t forget to check your redirection status.

Subscribe on Youtube

Article By
Harsh Agrawal is a blog scientist and a passionate blogger. He is blogging since 2008 & writes about Blogging, SEO, Make money online & tech. His blog, ShoutMeLoud receives 1 million Pageviews/month and have over 700K subscribers.


COMMENTs ( 16 )

  1. says

    Hello Harsh,
    I am facing this problem too after update.
    And I am not even using any Cache plugin for now. But still my site is not directing from non-www to www
    My WordPress Url and Site Address is same with http://www in start.
    Please Help

    • says

      Hey I solved it but i did it with adding simple code in .htaccess file.
      Its :

      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ – [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      RewriteCond %{HTTP_HOST} ^
      RewriteRule (.*)$1 [R=301,L]

  2. Bhuwan Roka says

    Hi !
    I want the site working without entering www infront of
    For eg: I am trying to view the site like this: but there is default web page not a website.

    Anyone help me would be great.


  3. says

    I was having the same problem too. I started deleting plugins one by one. When I deleted Yoast’s WordPress SEO the problem resolved. Could not see a setting in WordPress SEO which was breaking the redirect. Also, the homepage of the non-www version was out of date. No caching on either. Odd. Also, I only saw this problem when not logged in.

  4. Niklank @ ITMagazine says

    Harsh this is my first comment in your blog, actually I have setup a new blog in which I am going to provide all IT and SEO related information. Well here I want thank you for this non WWW to WWW redirection issue, I got solution for my blog. Thanks Again.

  5. Sandeep@Curious Little Person says

    what about backlinks harsh.. lets say ive built up backlinks to www and non http://www.. do i get credit for both .. or do we have to use a 301 permanent redirect to the preferred version..

    I was always under the assumption that you need to use 301 permanent redirect to get the credit for backlinks

    for the preferred domain , you can use google webmasters as well to set the one you prefer as well..

    would love to hear your views..

  6. Rakesh Kumar says

    I haven’t upgraded my blog into Version 3.1 yet but i have saved this tip for later reference. Thanks Harsh

  7. Sathish @ TechieMania says

    I am using Total cache for my blog and I tried the redirection just now. It is working perfectly. Seems this bug affected only few users.

  8. Deepanshu says

    i had this problem some days ago in mozilla but the support staff of bluehost rectified the problem:-)

  9. Usman@FirstHosting says

    I’ve read the same issue happening with some on on the forum, I will ask him to visit a solution here.

    thank for a share.