addRedirect(from, to, options = {}) {
        try {
            // encode "from" only if it's not a regex
            try {
                new RegExp(from);
            } catch (e) {
                from = encodeURI(from);
            }

            const fromRegex = this.buildRegex(from);
            const redirectId = from;
            
            this.redirects[redirectId] = {
                fromRegex,
                to,
                options
            };

            this.setupRedirect(redirectId);

            return redirectId;
        } catch (error) {
            if (error.message.match(/Invalid regular expression/gi)) {
                return null;
            }

            throw error;
        }
    }
@param {string} from
@param {string} to
@param {object} [options]
@param {boolean} [options.permanent]

@returns {string} The redirect ID