Allowing Redirect Code on Modern Sites
There needs to be a way to add a redirect code to modern sites. There will always be a need to redirect users from one to another for any number of reasons. There are currently 2 webparts available (Embed and Snippet) but neither actually allow code to be executed. Additionally, I would suggest renaming those webparts to something that it actually can do. Any reasonable end user would expect that if they select either of those webparts that they would be able to execute code of some sort.
Tom Burke commented
This doesn't necessarily have to be code, in my view...just a new version of the classic Redirect Page.
Another great feature would be if the user has Edit or higher permissions on the Site Pages library, the page gives a delay before redirect, so that it doesn't navigate away before you can open it for editing.