To return web users to a custom homepage when they log out, add the homeurl parameter to each FileMaker WebDirect solution's URL. For example: http://192.168.123.101/fmi/webd?homeurl=http://192.168.123.101/ xyz_home.html#Contacts
To answer your specific question about going to different URLs from each database after signing out, only way I can think of is to sign in to each database using different URLs, e.g:
Don't think there's anything you can do programmatically within each database (e.g. via scripting) that would allow you to determine where the browser goes after sign out (e.g. if you open all databases from launch center, or via more generic URLs).