How to Use URL Mappings: Managing 301 and 302 Redirects

How to Use URL Mappings: Managing 301 and 302 Redirects

By Michael Chen

December 2, 2024 at 05:54 AM

URL redirects help prevent visitors from reaching broken or duplicate pages by forwarding traffic from inactive to active pages. There are two main types of redirects: permanent (301) and temporary (302).

301 Redirects

  • Indicate permanent URL changes
  • Transfer search engine ranking to new page
  • Use when:
    • Changing page URLs
    • Deleting pages
    • Redirecting to different domains
    • After content imports with different URL structures

302 Redirects

  • Indicate temporary URL changes
  • Maintain original page's search ranking
  • Use when:
    • Temporarily updating pages
    • Rotating seasonal content
    • Replacing pages temporarily

Creating Redirects:

  1. Open Developer Tools
  2. Click URL Mappings
  3. Add redirects using correct formatting
  4. Click Save

Formatting Rules:

  • Include: Original URL -> New URL 301/302
  • Use [name] variable for collection items
  • Maintain URL capitalization
  • Avoid ?, &, # characters
  • 400 KB limit (approximately 2500 lines)
  • Higher redirects take precedence

Common Examples:

Changed Page URL:

/about -> /team 301

Deleted Page to Homepage:

/history -> / 301

Collection Items:

/store1/[name] -> /store2/[name] 301

External Domain:

/fundraiser -> https://external-domain.com 301

Seasonal Rotation:

/summer-sales -> /fall-sales 302
/spring-sales -> /fall-sales 302
/winter-sales -> /fall-sales 302

Important Notes:

  • Only works with integrated and custom domains
  • Cannot redirect image/file URLs
  • Cannot redirect homepage (/)
  • Original page must be deleted or deactivated
  • Keep redirects organized and remove inactive ones

Related Articles

Previous Articles