Redirect based on parameter in url
I want to redirect my site to the correct url based on parameter. The url is passed when changing the language of the site using the language switcher.
If url contains lang=de, then redirect to example.com/de/
If url contains lang=es, then redirect to example.com/es/
I’ve tried using the Redirection plugin by John Godley but I’m not sure how to set it up.
What’s the best way to get this done?