Redirects
Redirects are a critical part of maintaining site quality, SEO health, and user experience. They ensure users and search engines are sent to the correct destination when URLs change.
This guide explains when redirects matter, which tools we use at Terra, and how to choose the right approach depending on the project setup.
What is a Redirect?
Section titled “What is a Redirect?”A redirect tells the browser and search engines that a URL has moved to a new location.
Common reasons for redirects:
- Page or slug changes
- Content consolidation or removal
- Site restructures or migrations
- Temporary campaigns or experiments
When implemented correctly, redirects:
- Preserve SEO value
- Prevent broken links (404s)
- Maintain a smooth user experience
Common Redirect Types
Section titled “Common Redirect Types”301 – Permanent Redirect
Section titled “301 – Permanent Redirect”Use when a URL is permanently replaced by another.
- SEO value is transferred to the new URL
- This is the default choice for most production changes
302 – Temporary Redirect
Section titled “302 – Temporary Redirect”Use when the change is not permanent.
- SEO value is not fully transferred
- Useful for short-term campaigns or testing
410 – Gone
Section titled “410 – Gone”Use when a page is intentionally removed with no replacement.
- Tells search engines the content should be dropped from the index
Redirects in WordPress (Yoast SEO Premium)
Section titled “Redirects in WordPress (Yoast SEO Premium)”Some projects use Yoast SEO Premium for redirects (e.g. ProsperOps).
✅ Good use cases
Section titled “✅ Good use cases”- Editorial changes by non-developers
- Slug updates on posts or pages
- Simple 1:1 redirects
- SEO teams managing redirects without dev involvement
❌ Not great for
Section titled “❌ Not great for”- Large-scale migrations
- Bulk redirects
- Regex-heavy rules
- Environment-based logic
Yoast redirects are great for content-level changes, but not for structural URL changes.
Redirects in WordPress (Redirection Plugin)
Section titled “Redirects in WordPress (Redirection Plugin)”For most WordPress projects, we use the Redirection plugin.
Why we prefer it
Section titled “Why we prefer it”- Full control over:
- 301 / 302 / 410 status codes
- Regex-based redirects
- Conditional logic
- Import / export support
- Better logging and debugging
- Handles large redirect sets reliably
Considerations
Section titled “Considerations”- Redirects are database-based
- Should be reviewed during large migrations
This is our default choice for complex or large-scale redirect needs.
Redirects when using Sanity + Astro
Section titled “Redirects when using Sanity + Astro”For Sanity-based projects, redirects are handled at the application level.
How it works
Section titled “How it works”- We create a Custom Post Type (CPT) called Redirects in Sanity.
- Each redirect includes:
from(original path)to(destination URL or path)type(301 permanent or 302 temporary)
- Redirect data is fetched from Sanity.
- Astro consumes this data and applies redirects at build/runtime.
This approach allows:
- CMS-managed redirects
- Clear separation of content and routing logic
- Support for both internal and external redirects
Internal vs External Redirects
Section titled “Internal vs External Redirects”Internal redirects
Section titled “Internal redirects”- From:
/old-page - To:
/new-page - Most common use case
External redirects
Section titled “External redirects”- From:
/campaign - To:
https://external-site.com/page - Useful for partnerships, tools, or off-site flows
Both are supported across our setups.
What Redirects Do NOT Fix
Section titled “What Redirects Do NOT Fix”Redirects are powerful, but they are not a catch-all solution.
Avoid these anti-patterns:
- Using redirects to hide broken internal linking
- Redirecting everything to the homepage
- Long redirect chains (A → B → C)
- Using redirects instead of proper canonicals or noindex rules
If a URL shouldn’t exist, decide clearly:
- Redirect it
- Noindex it
- Or return a proper 404 / 410
Best Practices
Section titled “Best Practices”- Decide redirects early, especially during restructures
- Prefer 301 redirects unless there’s a clear reason not to
- Keep redirect rules simple and intentional
- Document large redirect changes
- Validate redirects before saying “it’s fixed”
Knowledge Check
Test your understanding of this section
Loading questions...