def sub_path(self, path):
if not self.regular_expression:<EOL><INDENT>return self.new_path<EOL><DEDENT>return re.sub(self.old_path, self.new_path, path)<EOL>
If this redirect is a regular expression, it will return a
        rewritten version of `path`; otherwise returns the `new_path`.