prepares links for db and webpages (even cleaner version)