ShoutMeLoud – Shouters Who Inspire

Superlinks
≡ Menu

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

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

nonwwwtowww thumb

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>

   9:

  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.

  • Author Bio

  • Latest Post

Article by Harsh Agrawal

Harsh has written 1068 articles.

If you like This post, you can follow ShoutMeLoud on Twitter. Subscribe to ShoutMeLoud feed via RSS or EMAIL to receive instant updates.


TA

{ 13 comments… add one }

  • Kulwant Nagi

    Solved like a charm.. I was trying to solve this issue for last 4-5 days..

    Big thanks.. :)

    Reply
  • Bhuwan Roka

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

    Anyone help me would be great.

    Thanks

    Reply
  • Jon

    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.

    Reply
  • Niklank @ ITMagazine

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

    Reply
  • Yousuf Khan Jee

    I am having WWW blog and have no problem. Everything is working smoothly!

    Reply
  • Sandeep@Curious Little Person

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

    Reply
  • Rakesh Kumar

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

    Reply
  • Sathish @ TechieMania

    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.

    Reply
  • Himanshu

    i have a www blog. no problems in there as yet.

    Reply
  • Deepanshu

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

    Reply
  • Usman@FirstHosting

    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.

    Reply
  • Pumama

    I use non WWW for my blog and don’t see any bug.
    I try typing http://www.techsharingdotnet in browser and Chrome changed automatically to techsharing[dot]net

    Reply
  • Antim Grahan

    Let Me try in My Blog Too. I m using Latest Version of Wp

    Reply

Leave a Comment