refactor creation of rewrite rules
distinguish between local and global link targets
add relative paths to Path API