deal with in-docroot installs and custom rewrites properly