I'm trying to make a photo gallery where the individual photos can be shared on Facebook and Twitter, and when you click the link, the photo that was shared will open in a lightbox automatically.
Most lightbox plugins provide a deep-linking feature that provides this in the form of a #! after the URL. Unfortunately, both the Facebook (https://www.facebook.com/sharer/sharer.php?u=http://google.com) and Twitter (http://twitter.com/share?text=My%20Tweet&url=http://google.com) share boxes strip out all text after the #. This means that when you try to share a deep-linked lightbox photo, the link just brings you back to the gallery rather than opening that photo.
The RewriteRule I came up with:
RewriteRule ^gallery/(.*)/$ /gallery/?photo=$1 [R]
Does work fine on a static site, but not in WordPress, which is why I'm here!
I'd prefer the URL to be /gallery/#!/123, but I know you can't add a #! with RewriteRule, so if anyone can think of a way to do that, it'd be even better!