prepares links for db and webpages (clean version)