How to Configure SEO-Friendly URLs Rewrite in Magento 2?
To configure SEO-friendly URL rewrites in Magento 2, follow these steps:
- Go to Stores > Configuration > General > Web in the admin panel.
- Expand the "Search Engine Optimization" section and set "Use Web Server Rewrites" to "Yes". This enables the use of Apache's mod_rewrite module to create SEO-friendly URLs.
- Click on the "Search Engine Optimization" section to expand it further, and set "Add Store Code to URLs" to "No". This removes the store code from the URL and makes it more user-friendly.
- Go to Marketing > SEO & Search > URL Rewrites in the admin panel.
- Click on the "Add URL Rewrite" button to create a new rewrite. Choose the type of rewrite you want to create, such as "Custom" for a custom URL or "Product" for a product URL.
- Enter the necessary information for the rewrite, such as the Request Path (the SEO-friendly URL you want to create), the Target Path (the actual URL of the page), and the Redirect Type (301 or 302).
- Click the "Save" button to create the rewrite.
- Repeat the process for all of the SEO-friendly URLs you want to create.
- Clear the Magento 2 cache by running the command bin/magento cache:clean.
- Test the new URLs by accessing them in your browser.
That's it! You have now configured SEO-friendly URL rewrites in Magento 2, which can improve the user experience and make your site more search engine-friendly.
1000+ Organizations That Trust Us
Thank you for your response. We will get back to you soon.
Something went wrong. Please submit your query again