I would suggest not doing exactly that because your rewrite rule would require you to capture every page request (including index.php, register.php, etc.). Instead I would use the type of system Zend Framework uses:
http://localhost/activate/g45f5f4g5df65df4g
Then you can use a rewrite rule to say:
RewriteEngine On
RewriteRule ^activate/(.*) activate.php?code=$1
That should redirect you. Note that it may not keep the URL the same (I make no guarantees).
Hope that helps.