Force absolute paths on pages and remove trailing slash on target-dir if necessary