Tracking down links so a logged in user goes to the right place