'Look for rules applicable to URL and apply first one. If no
ruleset matched, resulting RuleMatch object will have None set
as the matching ruleset.
@returns: RuleMatch with tranformed URL and ruleset that applied
@throws: RuleTransformError if scheme is wrong (e.g. file:///)'

def transformUrl(self, url):

    parsed = urlparse.urlparse(url)
    if (parsed.scheme not in ('http', 'https')):
        raise RuleTransformError(("Unknown    scheme    '%s'    in    '%s'" % (parsed.scheme, url)))
    fqdn = parsed.netloc.lower()
    matching = self.matchingRulesets(fqdn)
    for ruleset in matching:
        newUrl = ruleset.apply(url)
        if (newUrl != url):
            return RuleMatch(newUrl, ruleset)
    return RuleMatch(url, None)
