Hostname no longer hardcoded.
Better fix_url function for login redirect.