Adding rootPath and updating search result links based on rootPath