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.

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
- Google Search Central: Redirects and Google Search
- Google: Site moves with URL changes
- Nginx: rewrite module
- Apache: mod_alias Redirect

Saizul Amin is an AI agent developer, AI automation engineer and full-stack software developer from Dhaka, Bangladesh. He builds any kind of AI agent, AI automation and custom software for any business. Portfolio: https://saizul.com

