protected function replaceUrl($sitemapUrl, $replaceUrl) { $strippedUrl = $this->getStrippedUrl($sitemapUrl); $parts = explode($strippedUrl, $sitemapUrl); $url = rtrim($replaceUrl, "/"); $path = ltrim(end($parts), "/"); return $url . "/" . $path; }