Tweet Counter Works Everywhere But Front Page


#1

I have a WP site with a static front page. The tweet button count shows 0 for the main page. On my posts, the count works fine. This is driving me crazy. Is there any reason why the count would not be incremented on a static front page on a WP site?

The code for the buttons is the same everywhere. I’ve double checked that.

I’ve checked the count using http://urls.api.twitter.com/1/urls/count.json?url=http://mysite.com, and the JSON file returned always says,

{“count”:0,“url”:“http://mydomain.com/”}

So it seems for some reason the Twitter backend does not register tweets for this URL, even though I know it’s been tweeted much more than any posts on the site.

Any ideas?


#2

Would you share the URL in question?


#3

Sure, it’s http://easywpseoplugin.com

Thanks!


#4

It looks like your main page doesn’t respond to HTTP HEAD requests:

$ curl -I http://easywpseoplugin.com/

HTTP/1.1 403 Forbidden
Date: Thu, 17 Nov 2011 01:40:16 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
X-Pingback: http://easywpseoplugin.com/xmlrpc.php
Connection: close
Content-Type: text/html; charset=UTF-8

You’ll need to respond with a 200 so that the crawler knows that this is a valid URL.


#5

Ahh. Hmm, interesting. Not sure why it would do that for the main page and return 200 for the posts, which I assume is happening since their button counts are updated. I’ll have to look into this further.

Thanks! :smiley:


#6

OK, I use the BulletProof Security plugin, which inserts a bunch of fancy .htaccess mods to thwart XSS, SQL injection and other attacks. Apparently it considers HEAD requests a security vulnerability, though it’s odd it’s forbidden only on the main site URL. I’ll ask the developer about that.

RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC]

I removed “HEAD” from that line and now the server returns 200.

Thanks again! :slight_smile:


#7

Hopefully that should sort things out, please respond if it doesn’t.


#8

Thanks that helped me a lot


#9

#10