Tweet button support for www. and non-www. version of domain


With heroku changing its support for root domains I’ve had to move my site from http://mysite to http://www.mysite.

Is it possible to get the tweet button to count links to both? So a single button will count links to http://mysite…/somepage and http://www.mysite…/somepage?


Hello David,

You have a few options. In the tweet button , you can set a url param in the share url which will override the url of the page.

e.g.: Tweet

You can also use data-url and rel canonical in . For more information on the options here:


Hi Ara,
I can’t quite decipher the docs on this sorry.
If I set counturl=http://www.mysite/A, then links tweeted with and without the “www” will be counted? Or should it be the other way; where the actual URL has the “www” and the counturl does not?


Oops looks my code example didn’t come out right.

Example of tweet button with url parameter:


This way irrespective of whether the page is or just, the value in the url parameter is used for the count.

Make sure your url is encoded. You can something like this:

Hope this helps.