exploration of issue #5

searching for the root cause to #5 led me to a variety of things as the commit log shows.

you may want to cherrypick or advise on parts that make sense (like relative_url_root support) and others that don't.