Many Times, Magento Store Admin needs to modify the page URLs or disable unnecessary pages in this case store admin can create 301 redirect in Magento 2 to prevent 404 error.
When a category deleted from the catalog, and you need to redirect the links of that category to another category URL of your store, Magento provides the functionality of the category rewrite in the admin backend. Follow Steps to Create Category Rewrites in Magento 2.