Redirect everything after /
<blockquote>
  <p><a href="http://example.com/product/12312" rel="nofollow">http://example.com/product/12312</a></p>
</blockquote>

<p>I want to redirect everything after the /, in this case the "12312", to the site's root.</p>

<blockquote>
  <p><a href="http://example.com/" rel="nofollow">http://example.com/</a></p>
</blockquote>

<p>I tried playing with .htaccess, but couldn't get it to work.</p>