compatibility with root-relative urls, fixed subdir support