fix rewrite base detection for root of alias
merged branch Tobion/rewritebase-root (PR #540)

This PR was merged into the 2.2 branch.

Discussion
----------

fix rewrite base detection for root of alias

Bc break: no
Fixes #536

@fabpot please also merge 2.2 in to master then.

Commits
-------

680f09b fix rewrite base detection for root of alias