docs: public String substituteLinkForRootPath(CmsObject cms, String rootPath) {
  
          String siteRoot = OpenCms.getSiteManager().getSiteRoot(rootPath);
          if (siteRoot == null) {
              // use current site root in case no valid site root is available
              // this will also be the case if a "/system" link is used
              siteRoot = cms.getRequestContext().getSiteRoot();
          }
          String sitePath;
          if (rootPath.startsWith(siteRoot)) {
              // only cut the site root if the root part really has this prefix
              sitePath = rootPath.substring(siteRoot.length());
          } else {
              sitePath = rootPath;
          }
          return substituteLink(cms, sitePath, siteRoot, false);
      }