How to Use URL Mappings: Managing 301 and 302 Redirects
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:
- Open Developer Tools
- Click URL Mappings
- Add redirects using correct formatting
- 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