Categories: Magento 2 Tutorials

How To Write Redirect Rules In Magento 2

Disclaimer: Magenticians does not necessarily agree with the views expressed in this guest post. They are presented to bring to light all diverse views in the Magento and general ecommerce community.

Magento 2 offers some options that help to optimize the SEO of your Magento 2 store. Redirects are the most common approach developers use in web applications. Redirect usually means a rule or set of rules which helps to forward the user from one URL to another URL. When the rule goes into effect, any link that points to the targeted URL is redirected within seconds. URL redirection also makes your existing URLs more search engine friendly. In Magento 2, you can easily write the Redirect Rules by using the Magento 2 Admin Panel. Let’s take the following steps to redirect a custom URL to our targeted URL: Step 1: Login to your Magento 2 Store Admin Panel. Step 2: From the left sidebar, click “Marketing“. Step 3: Under the “SEO & Search” menu, tap “URL Rewrites“. Step 4: Click “Add URL Rewrite” button. Step 5: Select “Custom” from the drop-down list of the “Create URL Rewrite.” Step 6: Select your default store view from the drop-down in “Store” field. Step 7: In the “Request Path” field, enter the Requested URL. (Requested URL is the previous URL which will redirect to the targeted URL) Step 8: In the “Target Path” field, enter the Targeted URL which will serve as the target of the redirect rule for Requested URL. Step 9: Select either “Temporary (302)” or “Permanent (301)” in the “Redirect Type” using the drop-down list. Step 10: Tap “Save” button when you are done and you will see the success message “The URL Rewrite has been saved“. The above is a simple guide to write a URL Redirect Rule in Magento 2. This is a good practice to make your Magento 2 Store more SEO friendly and also helps to point your old URLs to the new ones so the user can stay longer on your website. If you have any question related to this tutorial, feel free to share your point in the comments section.
Fayyaz Khattak

Fayyaz is a Magento Community Manager at Cloudways - A Managed Magento Hosting Platform. He contributes as a Guest Author at Magenticians to share his knowledge with the Magento Community. Fayyaz is a food lover and enjoys driving.

View Comments

  • This is also not working for me. I wish to redirect customer/account/create to account/account/login but it doesn't work. Do I need to include in htaccess file? I have also refreshed cache and indexes.

Share
Published by
Fayyaz Khattak

Recent Posts

Building Employee Trust and Dedication – A Complete Guide

In the highly competitive modern workplace, trust, and employee loyalty are crucial factors for long-term… Read More

3 months ago

12 Winning Strategies for Small Businesses Marketing

In the ever-evolving world of small business developing and implementing effective marketing strategies is critical to… Read More

3 months ago

Top 10 App Development Companies in Dubai 2024

With one of the highest internet penetration rates, the UAE has set out to revolutionize… Read More

3 months ago

Transforming Industries: How Amazons GPT44X is Revolutionizing AI Technology

Artificial Intelligence (AI) has been continually evolving, leading to remarkable advancements in various industries. Among… Read More

8 months ago

Top Magento 2 Extensions for 2023

Extensions, extensions and lots of extensions. We all love extensions, don’t we? After all, extensions… Read More

11 months ago

Unleashing the Power of Software Testing: Cooperating with a Testing Firm

Software quality is crucial to a firm's success across industries in the quickly changing digital… Read More

12 months ago