Change prefix matching to match whole path instead of path component.