make base URL auto-detection work when friendly (non-rewrite) URLs are enabled. closes #266