Redirects are how you move content without breaking links or losing search visibility. A permanent (301) redirect tells browsers and search engines that a URL has moved for good. Used carelessly, redirects create chains, loops and lost traffic.

Redirect types compared: 301 permanent, 302 temporary, 307/308 and meta refresh
Permanent moves get 301 or 308; temporary ones get 302 or 307.

From my own work: In migrations I always export the old URL list first, map every important URL to its closest new equivalent and test the map with a crawler before switching DNS.

When to use a 301

  • A page moved to a new URL or was merged into another page.
  • HTTP to HTTPS, or non-www to www (or the reverse).
  • Domain change or site restructuring (site move guide).

Google treats permanent server-side redirects as a strong canonical signal (Google redirects guide).

Nginx examples

# HTTP -> HTTPS and non-www -> www (in the port 80 server block)
return 301 https://www.example.com$request_uri;

# single page
location = /old-page/ { return 301 /new-page/; }

# whole folder with regex
location ~ ^/blog/(.*)$ { return 301 /articles/$1; }

See the Nginx rewrite module.

Apache (.htaccess)

Redirect 301 /old-page/ https://www.example.com/new-page/
RedirectMatch 301 ^/blog/(.*)$ https://www.example.com/articles/$1

WordPress

Use a redirect manager (Redirection, Yoast Premium or Rank Math) for editorial changes. Put domain-wide rules (HTTPS, www) at the server level for speed.

Common mistakes

  • Chains: A→B→C. Point A straight to C.
  • Loops: often caused by conflicting server and plugin rules or Cloudflare “Flexible” SSL.
  • Redirecting everything to the homepage: Google may treat this as a soft 404; map to relevant pages.
  • Using 302 for permanent moves.
  • Forgetting internal links: update them to the final URL.

Testing

curl -sIL https://example.com/old-page/ | grep -iE '^(HTTP|location)'

Then crawl the site and check Search Console for 404s. For a full migration checklist see migrating WordPress to a VPS.

Want this done on your own server or site?

I am Saizul Amin, a web developer and technical SEO consultant. I set up and harden VPS servers, migrate WordPress sites, fix indexing problems and build automations. See my portfolio or get in touch.

FAQ

Do 301 redirects lose PageRank?

Google says permanent redirects do not cause PageRank loss today, but chains and irrelevant targets still hurt.

How long should I keep redirects?

At least a year, and ideally permanently for URLs with external links.

301 or 308?

Both are permanent; 308 preserves the HTTP method. For normal page moves, 301 is fine.

Sources

NEW BLOGS. REAL STRATEGIES. REAL RESULTS.

Join our community and receive powerful SEO tips, web optimization guides, and growth strategies as soon as they’re published.

Don’t just read blogs — stay ahead of the competition.

We don’t spam! Read our privacy policy for more info.

Share.
Leave A Reply