diff --git a/src/SharePoint/Web.php b/src/SharePoint/Web.php index cf4aee10..46035421 100644 --- a/src/SharePoint/Web.php +++ b/src/SharePoint/Web.php @@ -2140,8 +2140,8 @@ public function getResourceUrl() if (!is_null($this->webUrl)) { $urlInfo = parse_url($this->getContext()->getBaseUrl()); $rootSiteUrl = $urlInfo['scheme'] . '://' . $urlInfo['host']; - return "{$rootSiteUrl}{$this->webUrl}/_api/web"; - #return str_replace("/_api", "{$this->webUrl}/_api", $url); + $webPath = str_replace($rootSiteUrl, "", $this->getContext()->getBaseUrl()); + return str_replace("{$webPath}/_api", "{$this->webUrl}/_api", $url); } return $url; }