When re-writing is disabled, and the deployment directory contains either 'app' or 'webroot' the computed path was incorrect. Fixes #2330