Something like
PHP Code:
if ($_SESSION['customer_id']) { //there will only be a customer_id if logged in
  //link for normal store operation
} else {
  
//link back to landing page

transitioning betwen PHP and HTML as necessary.

If you post the relevant section of tpl_header.php and the exact links you want (with the actual domain/subdirectory obfuscated if you wish), we can give you more detailed advice.