How does Twitterbot handle shebang (#!) URLs on dynamic websites?


I run SmugMug, a popular photo & video sharing service with over 35M visitors a month, and I just implemented Twitter Cards last night.

One question that’s not obvious from the docs is how you handle shebang (#!) URLs on dynamic sites like SmugMug (& Twitter). I’m hoping Twitterbot uses escaped_fragment notation much like other bots (see: but it’s not clear.

As an example, we have our canonical URL for a photo in a gallery here:

But depending on a variety of things, including your browser type & version, you probably see something more like:!i=131487110&k=FdKeW

Over time, we expect our URLs to drift to the former, rather than the latter, but today shebang URLs are easily the most common, and I want to make sure we’re serving up the right Twitter Card to Twitterbot.

Example with escaped_fragment: (hmm, the discussions are trimming this a little, you’ll need to manually edit slightly to re-add the first underscore to see what I’m talking about)



So it appears that the twitter bot doesn’t use an escaped fragment. Perhaps you can help put some pressure on twitter to fix this.


This issue has been resolved; the Twitterbot now supports #! by converting to “escaped_fragment.”