🔄 What is a Redirect? #
A redirect sends users (and Google) from one URL to another.
👉 Used when:
- Domain change (example.com → newsite.com)
- Multiple URLs for same page (www vs non-www vs subdomain)
- Website merger
- Page removed or replaced
📌 Key Rule: Always Pick a Canonical URL #
- Decide your main URL version
(Example: https://www.example.com) - Redirect all alternate versions to this main one.
🛠 Types of Redirects & When to Use Them #
| Redirect Type | Code | Duration | Google Signal | When to Use |
| Permanent | 301 / 308 | Long-term | Strong (passes SEO value) | Site move, URL change |
| Temporary | 302 / 307 | Short-term | Weak (source might stay in index) | Testing, temporary page move |
| Meta Refresh (0s) | HTML | Long-term | Weak-medium | If server redirect isn’t possible |
| Meta Refresh (>0s) | HTML | Short-term | Weak | Avoid unless necessary |
| JavaScript Redirect | JS | Varies | Weak | Last resort if no server control |
✅ Best Practices for Redirects #
- Prefer server-side redirects (301/308 or 302/307)
- Avoid redirect chains (A → B → C → D slows crawling)
- Update internal links to point directly to new URLs
- Use 301 for SEO moves (passes link equity)
- Test redirects in Search Console & with curl -I command
🚫 Common Mistakes #
- ❌ Using 302 instead of 301 for permanent moves
- ❌ Leaving multiple hops (Google may drop link equity)
- ❌ Forgetting to update sitemaps & internal links
- ❌ Using only JavaScript redirects (Google might miss them)
💡 FSIDM Pro Tip:
👉 After setting redirects, submit your updated sitemap and request re-indexing in Google Search Console to speed up the transition.
⚡ Server-Side Redirects: The Best Practice #
Server-side redirects tell browsers + Google the correct location of a page directly from the server.
- Best for SEO
- Fastest (no extra rendering needed)
- Works for both permanent & temporary moves
🛠 Types of Server-Side Redirects #
| Redirect Type | Status Code | Purpose |
| Permanent | 301 / 308 | URL change for good (SEO passes to new page) |
| Temporary | 302 / 307 | Short-term move (old URL stays in search results) |
💻 How to Implement (Examples) #
🔹 PHP Redirect #
// Permanent (301)
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location: https://example.com/newurl’);
exit();
// Temporary (302)
header(‘HTTP/1.1 302 Found’);
header(‘Location: https://example.com/newurl’);
exit();
🔹 Apache (.htaccess) Redirect #
# Permanent Redirect
Redirect permanent “/old” “https://example.com/new”
# Temporary Redirect
Redirect temp “/old-temp” “https://example.com/temp”
Using mod_rewrite for more control:
RewriteEngine on
RewriteRule “^/service$” “/about/service” [R=301] # Permanent
RewriteRule “^/service$” “/about/service” [R=302] # Temporary
🔹 NGINX Redirect #
# Permanent Redirect
location = /service {
return 301 https://example.com/about/service;
}
# Temporary Redirect
location = /service {
return 302 https://example.com/about/service;
}
Complex rewrite example:
location /service {
rewrite ^/service/offline/([a-z]+)/?$ /about/service permanent; # 301
}
✅ FSIDM Best Practices #
- Always prefer 301 for SEO moves
- Avoid redirect chains (A → B → C — keep it A → C)
- Update sitemaps & internal links after redirect
- Test in Google Search Console & with curl -I <URL>
- Keep redirects live for at least 1 year for permanent moves
⚡ Meta Refresh Redirects #
👉 Used when server-side redirects (301/302) aren’t possible.
🔹 Types of Meta Refresh #
| Type | Trigger | Google’s Interpretation |
| Instant | 0 seconds after page load | Permanent redirect |
| Delayed | X seconds after page load | Temporary redirect |
📄 HTML Example (Instant – Permanent) #
<!doctype html>
<html>
<head>
<meta http-equiv=”refresh” content=”0; url=https://example.com/newlocation”>
<title>Redirecting…</title>
</head>
</html>
📄 HTML Example (Delayed – Temporary) #
<!doctype html>
<html>
<head>
<meta http-equiv=”refresh” content=”5; url=https://example.com/newlocation”>
<title>Redirecting in 5 seconds…</title>
</head>
</html>
💻 HTTP Header Equivalent #
HTTP/1.1 200 OK
Refresh: 0; url=https://example.com/newlocation
⚡ JavaScript Redirects #
👉 Only use if server-side & meta refresh aren’t possible (Google renders JS later — risk of failure).
<!doctype html>
<html>
<head>
<script>
window.location.href = “https://example.com/newlocation”;
</script>
<title>Redirecting…</title>
</head>
</html>
⚡ Crypto Redirects (Last Resort) #
👉 Not a real redirect — just a link + notice for users & Google may treat it like a hint.
<a href=”https://newsite.example.com/newpage.html”>
We moved! Find the content on our new site!
</a>
⚠ Not reliable for SEO → Use only if all other methods fail.
✅ FSIDM Best Practices for Non-Server Redirects #
- Always prefer server-side redirects (301/302) if possible
- Use meta refresh only as fallback (instant for permanent, delayed for temporary)
- JS redirects should be your last coding option
- Crypto redirects are just emergency placeholders
- Test all redirects in Google Search Console + curl -I