Skip to main content
Magento 2

How to Create URL Redirect in Magento?

Guide to setting up and managing URL redirects in Magento 2 for SEO and user experience.

How to Create URL Redirect in Magento?

URL redirects help manage broken links and maintain SEO value when pages change. Learn how to set them up in Magento.

Why URL Redirects Matter

  • Preserve SEO rankings
  • Fix broken links
  • Improve user experience
  • Manage old URLs
  • Track link changes
  • Prevent 404 errors

Types of Redirects

  • 301: Permanent (recommended for SEO)
  • 302: Temporary
  • 303: See other
  • 307: Temporary redirect

Creating Redirects in Admin Panel

  • Go to Marketing > SEO & Search > URL Rewrites
  • Click “Add URL Rewrite”
  • Select “Custom” (if creating manual redirect)
  • Enter request path (old URL)
  • Enter target path (new URL)
  • Set redirect type (301/302)
  • Save rewrite

Automatic Redirects

Magento automatically creates redirects when:

  • Changing product URLs
  • Moving categories
  • Renaming CMS pages
  • Changing attribute URLs

Bulk URL Redirects

For multiple URLs:

  • Create CSV file with old and new URLs
  • Use import functionality
  • Or create redirects programmatically

Manual Redirect Methods

Using .htaccess

Code implementation available in the full documentation.

Code implementation available in the full documentation.

Common Redirect Scenarios

  • Product discontinued → Related product
  • Category renamed → New category
  • Page moved → New page location
  • Protocol change → HTTPS redirect
  • Domain migration → New domain

Best Practices

  • Use 301 redirects for permanent changes
  • Keep redirect chains short
  • Avoid redirect loops
  • Update internal links
  • Test redirects thoroughly
  • Monitor 404 errors
  • Update sitemaps
  • Update robots.txt if needed

Monitoring Redirects

  • Use Google Search Console
  • Check server logs
  • Monitor 404 errors
  • Use redirect checker tools
  • Test periodically

Need help with this?

Get managed Magento hosting tuned for performance.

Learn more