Skip to content

Commit

Permalink
Update StaticpagesController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
michelsteege authored Jun 29, 2018
1 parent fdc0b8e commit 6108dc9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Controllers/StaticpagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ public function transformURL($url)
$newURL = $httpHost ? str_replace($parts['host'], $httpHost, $url) : $url;

//Create path
$path = Director::baseFolder() . '/' . $this->_cachepath . '/' . $httpHost . $parts['path'];
if($httpHost){
$path = Director::baseFolder() . '/' . $this->_cachepath . '/' . $httpHost . $parts['path'];
}else{
$path = Director::baseFolder() . '/' . $this->_cachepath . '/' . preg_replace('#^https?://#', '', $newURL);
}
$this->_paths[$url] = [
'path' => $path,
'url' => $newURL
Expand Down

0 comments on commit 6108dc9

Please sign in to comment.