API Refrence for 301 Redirects

For anyone still wondering how to do this, I made a simple javascript hack that works. I was using Chrome developers tools console for this. Just copy/paste this code in to the console on the hosting tab in Webflow dashboard (and of course change the URLs):

var hostingContainer = document.getElementsByClassName('hosting-tab')[0];
var hostingController = angular.element(hostingContainer);
var scope = hostingController.scope();

var redirects = [
  {source: '/old1', target: '/new1'},
  {source: '/old2', target: '/new2'},
  {source: '/old3', target: '/new3'},
  {source: '/old4', target: '/new4'},
];

redirects.forEach(function (rule) {
  scope.redirectPath = rule.source;
  scope.redirectTarget = rule.target;
  scope.addRedirect();
});
2 Likes