working version of the redirection plugin