I have a requirement wherein I need to redirect multiple categories to external site's respective category pages. For the same I have created categories in magento. Whenever we create a category in magento it creates a url rewrite so that you can access category via url_key.
Category name: Events
Category url_key: events
category url: events.html
category url rewrite target path: catalog/category/view/id/175
Now if I try to create url rewrite for events.html, it gives me error "Request Path for Specified Store already exists."
I know I can delete the existing url rewrite and create new where request path is "catalog/category/view/id/175" and target path is external site url. (in this case request path can not be events.html as magento will never find events.html as we have deleted the url rewrite)
However, I do not wish to go with category ids as category ids will be different on different environments like dev, stage and production. Plus I do not want to manually delete all those url rewrites that magento has created.