[ticket/26] Fix profile link rewriting

Rewriter was tricked by path helper uri based path which included
virtual directories
Merge pull request #28 from dcz/ticket/26

Ticket/26 Fix profile rewriting