Managing URL rewrites in Magento allows you to create custom URLs for your products, categories, and CMS pages, which can help improve SEO and provide a better user experience. Here's a step-by-step guide to help you manage URL rewrites in Magento:
Step-by-Step Guide to Manage URL Rewrites in Magento
Step 1: Access URL Rewrites Management
-
Log in to the Admin Panel:
- Go to your Magento admin URL and log in.
-
Navigate to URL Rewrites:
- Go to
Marketing > SEO & Search > URL Rewrites
.
- Go to
Step 2: Create a New URL Rewrite
-
Click on Add URL Rewrite:
- Click the
Add URL Rewrite
button.
- Click the
-
Choose a URL Rewrite Type:
- Select the
Create URL Rewrite
option to create a custom URL.
- Select the
-
Fill in URL Rewrite Information:
- Request Path: Enter the URL path you want to rewrite (e.g.,
old-url-path
). - Target Path: Enter the actual URL path that the request should be redirected to (e.g.,
catalog/product/view/id/1
). - Redirect Type: Choose the type of redirect (usually
Permanent (301)
). - Store: Select the store view to which this URL rewrite applies.
- Request Path: Enter the URL path you want to rewrite (e.g.,
-
Save URL Rewrite:
- Click
Save
to create the URL rewrite.
- Click
Step 3: Edit an Existing URL Rewrite
-
Search for the URL Rewrite:
- Use the search filters to find the existing URL rewrite you want to edit.
-
Select the URL Rewrite:
- Click on the URL rewrite you want to edit.
-
Edit URL Rewrite Information:
- Modify the
Request Path
,Target Path
,Redirect Type
, andStore
as needed.
- Modify the
-
Save URL Rewrite:
- Click
Save
to apply the changes.
- Click
Step 4: Delete a URL Rewrite
-
Search for the URL Rewrite:
- Use the search filters to find the URL rewrite you want to delete.
-
Select the URL Rewrite:
- Click on the URL rewrite you want to delete.
-
Delete the URL Rewrite:
- Click the
Delete
button to remove the URL rewrite.
- Click the
Step 5: URL Rewrites for Products, Categories, and CMS Pages
-
Product URL Rewrites:
- Navigate to
Catalog > Products
. - Select a product and go to the
Search Engine Optimization
section. - Modify the
URL Key
to create a custom URL for the product. - Click
Save
to apply the changes.
- Navigate to
-
Category URL Rewrites:
- Navigate to
Catalog > Categories
. - Select a category and go to the
Search Engine Optimization
section. - Modify the
URL Key
to create a custom URL for the category. - Click
Save
to apply the changes.
- Navigate to
-
CMS Page URL Rewrites:
- Navigate to
Content > Elements > Pages
. - Select a CMS page and go to the
Search Engine Optimization
section. - Modify the
URL Key
to create a custom URL for the CMS page. - Click
Save
to apply the changes.
- Navigate to
Step 6: Manage URL Rewrites via Database
For advanced users, URL rewrites can also be managed directly via the database. However, this requires careful handling to avoid breaking links.
-
Backup Your Database:
- Always create a backup of your database before making direct changes.
-
Access URL Rewrite Table:
- Use a database management tool like phpMyAdmin or a MySQL client to access your Magento database.
- Find the
url_rewrite
table.
-
Modify URL Rewrites:
- Insert, update, or delete rows in the
url_rewrite
table as needed.
- Insert, update, or delete rows in the
-
Clear Cache:
- Go to
System > Cache Management
. - Select all caches and refresh.
- Go to
Additional Tips
-
SEO Considerations:
- Use descriptive and keyword-rich URL keys to improve SEO.
- Avoid changing URLs frequently to maintain search engine rankings.
-
Redirect Management:
- Use 301 redirects for permanent changes to preserve SEO value.
- Use 302 redirects for temporary changes.
-
Test Changes:
- After creating or modifying URL rewrites, test the URLs to ensure they redirect correctly.
Conclusion
By following these steps, you can effectively manage URL rewrites in Magento, enhancing your store's SEO and user experience. Proper URL management helps maintain clean, descriptive URLs that are easy for both search engines and users to understand.