title: How to detect that it's Twitter requesting my page
body: <p>According to Tweet Button documentation (<a href="https://dev.twitter.com/docs/tweet-button/faq#count-api-increment" rel="nofollow">https://dev.twitter.com/docs/tweet-button/faq#count-api-increment</a>) posted article must be accessible with HTTP response code 200, to allow Twitter counting your articles.</p>
  
  <p>Current set up of our website is this:
  1. article URL has following link: /post/:date/:title
  2. link which is shared via Twitter is: /:date/:title (I don't know why - I didn't design it)
  3. when someone is accessing the second link, backend code is performing 301 redirect to the first link</p>
  
  <p>To fix Tweets counting I need to serve response code 200 with JS script code to perform redirect(e.g. window.location = '...'). But it will break 301 redirects for Google bot crawling the website, which is something we want to avoid (SEO reasons).</p>
  
  <p>So the only solution I see is to leave 301 redirect, and serve different one only to Twitter, when it's trying to <code>curl</code> my website.</p>
  
  <p>But how to do it?</p>