Use hostname configuration variable consistently

Also removes the hostname from links where it's not necessary.