title: How to stop fan gate / like gate from redirecting to wall when clicking "Like"
body: <p>I've created a Facebook fan page that works as a fan gate / like gate.  When the user clicks the "Like" button the page redirects to the wall.  I want to override this behavior and have the page redirect back to the Liked version of the fan gate.  The app is an iFrame page tab app using the PHP signed request to determine liked/notliked status.</p>
  
  <p>An example of this is <a href="http://www.facebook.com/1800flowers" rel="nofollow">http://www.facebook.com/1800flowers</a>
  When you like the page, it redirects you to <a href="http://www.facebook.com/1800flowers?sk=app_116748578401618" rel="nofollow">http://www.facebook.com/1800flowers?sk=app_116748578401618</a></p>
  
  <p>So my search-fu found a piece of JavaScript that was supposed to fix this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      if (top != self) top.window.location = 'linkgoeshere';
  &lt;/script&gt;
  </code></pre>
  
  <p>I've tried placing this block of JavaScript in both the have liked and have not liked sections of the page.  Either way it creates a redirect loop where the page just continually refreshes.</p>
  
  <p>If this code is the answer, where should it be located, and what should "linkgoeshere" be replaced with?  There is a possibility I've been using the wrong link.</p>
  
  <p>If this isn't the answer, is there an alternative?</p>