Rewrite links with implied hosts and allow for selector replacement.