[WIP] Initial version of redirect script (untested)