Masking external links with internal link for member-only

You will want to add the hook function in your functions.php file:

$user = wp_get_current_user();
if($user->exists) {
    add_filter('public_link_root', function() { return 'example.com'; } );
}

Then whenever you are working with a URL in any of your template files, you can allow the URL to be modified by your customer filter public_link_root. The filter will only run if the user exists, otherwise the URL won’t be altered.

So in your template files:

$some_link = apply_filters('public_link_root', 'ourwebsite.com') . '/resources';
echo '<a href="' . $some_link . '">View Resources</a>';

For this to make more sense, you should spend some time reading the documentation and example code on add_filter and apply_filters.