Adding redirects using a custom module (no contrib module) in Drupal 8 to 11. Add redirects conditionally without any contrib modules.
Start building your own custom modules in Drupal with this beginner's guide.