How to use controller to redirect customers to another URL in Magento 2

- Magento 2

Magento 2 Development

In Magento 2, you can use the following code to redirect customers to another URL with the help of controller:

Some examples from the core:

Source

More tips from the Cookbook