public function relativePath($url) { $path = $this->toPath($url); if (!preg_match('#' . $this->config['path'] . '#', $path, $matches)) { throw new Exception("{$url} doesn't match `{$this->config['path']}`"); } return $matches[1]; }