Hey, Magento Buddies!
If you’re redirected URL not working properly, you may lose traffic. You can easily redirect your customers to new URL addresses by enabling URL rewrite for Magento 2. Rewriting URLs makes them more search engine friendly. Deep dive into How to Add URL Rewrite Programmatically in Magento 2.
Attachment 16859
For More Details: How to Add URL Rewrite Programmatically in Magento 2