'Apply rules from this ruleset on the given url. Exclusions
are checked.
@param url: string URL'

def apply(self, url):

    if self.excludes(url):
        return url
    for rule in self.rules:
        try:
            newUrl = rule.apply(url)
            if (url != newUrl):
                return newUrl
        except Exception as e:
            raise Exception(((e.__str__() + '    ') + rule.fromPattern))
    return url
