Refactored db methods. Added domain redirects to apache config.