Allow base uri to be provided

Since we're rewriting more than just the hostname
the client needs to be able to specify the base
uri rather than just the hostname.