Adding dynamic redirects. Fix for #793

*Do not merge this yet!!!!*

It appears to work so far :-)