So a user who is not logged will see the same link as a user who is logged, the difference is that the logged user will see a different page after following the link.

Please note that I would like the link to stay intact, meaning that I don't want to replace the final url with another one. Also, I would like to avoid playing with cookies.

If it can't be done using rewriteengine, is there another way involving .htaccess / php?