Rewrite issue when not installed under root dir

Not a high priority as I assume most people using this tool know what they are doing but for the sake of completeness, here is fix to the rewrite rules for when installing in a subdirectory.
Merge pull request #8 from steegi/non-root-rewrite-issue

Rewrite issue when not installed under root dir