host_name can potentially be longer than site_url, so it's not a good base for determinig the prefix
use prefix from connection instead of unsafe conjecture between autodetection and (potential) user input
Don't use domain name where it is not needed