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>
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.
I’m having the same issue now but I’m using a rocket caching plugin, how do I solve the problem please?
Thanks Harsh, Finally redirection problem solved.
Hey harsh thanks works like charm
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
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} ^viralindians.com
RewriteRule (.*) http://www.viralindians.com/$1 [R=301,L]
Solved like a charm.. I was trying to solve this issue for last 4-5 days..
Big thanks.. 🙂
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
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.
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
I am having WWW blog and have no problem. Everything is working smoothly!
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..
I haven’t upgraded my blog into Version 3.1 yet but i have saved this tip for later reference. Thanks Harsh
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.
i have a www blog. no problems in there as yet.
i had this problem some days ago in mozilla but the support staff of bluehost rectified the problem:-)
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.
I use non WWW for my blog and don’t see any bug.
I try typing http://www.techsharing[dot]net in browser and Chrome changed automatically to techsharing[dot]net
Let Me try in My Blog Too. I m using Latest Version of Wp