I want to achieve the following:
- On a post or a page, I can define an optional custom redirect URL (possibly as an Advanced Custom Field)
- If I view this post/page with a specific added URL parameter (like "?redirect=true", send a redirect to the defined custom URL, otherwise do not redirect.
My naive approach would be to add this as a javascript to the post/page template.
Is there a better option? Or a plugin I could (ab)use for that purpose?