@beee thanks for the quick reply, pastebin link is great. What was the issue with it redirecting at first for you which was solved through the linked file, not building the url properly? I’ve tried adapting the link you provided to rewrite the permalink on my site, but seem to be struggling.
Cheers