use url_for to support installs which are not at the root of a domain/subdomain
fix refs for non-root domain installs