The authoritative place to ask this question would be to the developer of your widget, or if you developed the code yourself, post a question in Twitter's Developer Site I see similar questions to yours, but not an exact match, on their developer questions page: Backlinks
Most popular social widgets use the same API supplied by the social site like Twitter, and add some JavaScript functionality or other share buttons on top of that. Looking at the Twitter Button Docs I can see that the widget would supply the url
to share and the screen name
of the Twitter account to attribute the shared URL to.
You'll have to change the url
either in the widget or your developer JavaScript code to reflect the new sub-directory. It looks like they store the count
in the Twitter account specified in your widget or developer code, so I think it should maintain the same count regardless of the url
.
To confirm this, you could simply start another Twitter account, post a copy of your widget or developer code somewhere, and then change the url
to somewhere different to see if the count starts at zero again.
In the developer docs, there's a section called "Sharing a short URL" which talks about the count not incrementing past zero if you use a URL shortening service. But since you'll just be doing a 301 redirect to the sub-directory it should increment fine.
The URL that people shared via your webpage previously should also resolve fine since that will just redirect anyone who clicks on the URL in Twitter to the sub-directory.