public function url_matcher($matches)
    {
        list($changed, $newurl) = $this->relative_match($matches['url']);
        if ($changed) {
            return str_replace($matches['url'], $newurl, $matches[0]);
        }

        list($changed, $newurl) = $this->found_file_match($matches['url']);
        if ($changed) {
            return str_replace($matches['url'], $newurl, $matches[0]);
        }

        return $matches[0];
    }