make pathrewrite respect protected basepath