title: Canonical url and og:url for multilanguage site
body: <p>I read a lot about these subjects and I know that no solution is perfect to handle a multilanguage site. I'm using <a href="https://support.google.com/webmasters/answer/182192?hl=en" rel="noreferrer">different folder</a> to serve content for different languages, thus I have <code>www.example.com/en</code>, <code>www.example.com/es</code>, etc.</p>
  
  <p>When a user visit the site for the first time at <code>www.example.com</code> I choose the best matching language from <code>Accept-Language</code> HTTP header and redirect it to the most appropriate page using <code>en</code> version if no language match. For this reason there is no real page at <code>www.example.com</code> and it always generates a redirect.</p>
  
  <p>This is working very well for both users and search engines however there is a flaw in this approach, likes are spread across different languages, I want all of them for <code>www.example.com</code></p>
  
  <p>If I set <code>og:url</code> to root page FB crawler complaints about redirect loop because it goes from <code>www.example.com</code> then it's redirected to <code>www.example.com/en</code> which has <code>og:url</code> set to <code>www.example.com</code>. I want to keep likes unified i.e. a like for <code>www.example.com/es</code> and a like for <code>www.example.com/en</code> should both count for main domain.</p>
  
  <p>My current solution is to modify the redirect code in this way: when user agent is facebook never redirect when <code>www.example.com</code> is requested. Use default locale or locale <a href="https://developers.facebook.com/docs/opengraph/guides/internationalization" rel="noreferrer">requested by FB</a> with <code>fb_locale</code> param.</p>
  
  <p>I've also added locale open graph tags to tell FB about different locales for my page.</p>
  
  <p>Finally I kept the canonical url tag with the locale portion because each language is serving its own content in this way search engines should be aware of that. This is (more or less) the head section of the home page</p>
  
  <pre><code>&lt;meta content="website" property="og:type" /&gt;
  &lt;meta content="http://www.example.com/" property="og:url" /&gt;    
  &lt;meta content="en_US" property="og:locale" /&gt;
  &lt;meta content="es_ES" property="og:locale:alternate" /&gt;
  &lt;meta content="fr_FR" property="og:locale:alternate" /&gt;
  &lt;link href="http://www.example.com/en" rel="canonical" /&gt;
  </code></pre>
  
  <p>In this way everything seems to work and like count are shared across all languages. I'm only getting a warning by facebook debugger </p>
  
  <blockquote>
    <p>Mismatch og:url and canonical url: og:url tag in the header is not the
    same URL as rel='canonical' link in the html.</p>
  </blockquote>
  
  <p>Is this setup correct? Will I have any issue with this markup?</p>
  
  <p><a href="https://stackoverflow.com/questions/15514311/difference-between-rel-canonical-and-ogurl">Similar question</a> but he wants likes per country.</p>