code: function addRedirects(metaObj, uri) {
    const { urlHistory } = metaObj;
  
    if (urlHistory.length > 1) {
      // there are old urls! redirect the previous url to latest url
      let prevUrl = parse(urlHistory[urlHistory.length - 2]),
        prevUri = `${prevUrl.hostname}${prevUrl.pathname}`,
        newUrl = parse(_.last(urlHistory)),
        newUri = `${newUrl.hostname}${newUrl.pathname}`,
        prefix = getPrefix(uri);
  
      // update the previous uri to point to the latest uri
      return db.put(`${prefix}/_uris/${buf.encode(prevUri)}`, `${prefix}/_uris/${buf.encode(newUri)}`)
        .then(() => metaObj);
    }
  
    return metaObj;
  }
docs: add a 301 redirect to the previous uri
  note: we only need to add it to the previous one, because ones before will point
  to it, e.g. /one.html → /two.html → /three.html
  multiple 301s on the same server have no performance penalties
  
  @param {Object} metaObj
  @param {string} uri
  @returns {Promise|undefined}