0

I want to do URL Rewrite of wishlist link to favourites but don't know how to do it if anyone can mention the whole process it will b great.

I really appreciate any help you can provide.

1 Answer 1

0

Creating a URL rewrite is very easy, just navigate to "Marketing", then "URL Rewrites", and click the "Add URL Rewrite" button on the top. You will then be presented with the below form, in your case you need to set "Request Path" to favourites (without a leading slash) and "Target Path" to wishlist. Make sure "Redirect Type" is set to "No" if you wish to override the URL instead of just redirecting to it.

URL Rewrite creation form in Magento 2

3
  • Thank you @Mohamed ELIDRISSI but I need to do this with code if you have a solution for that too then please provide and without URL rewrite is possible then also acceptable Jun 7, 2022 at 10:07
  • @ParthPatel I'm sorry I'm not very familiar with Magento 2 codebase, but I found a link online that might be helpful to you: magecomp.com/blog/add-url-rewrite-programmatically-magento-2 Try using the code inside the execute method and replace the values with the same ones I mentioned in my answer and set the redirect type to 0.
    – Mohamed
    Jun 7, 2022 at 10:27
  • I have tried that but not working Jun 7, 2022 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.