Redirects are how you point one URL at another. Visitors going to oldsite.com end up at newsite.com. Visitors to yoursite.com/old-page see the content at /new-page. Used correctly, redirects preserve SEO rankings, keep bookmarks working, and gracefully reorganize URLs. Used incorrectly, they tank traffic and confuse search engines. This guide covers the redirect types, where to configure them, and the common mistakes.
301 vs 302 — the critical distinction
| 301 (Permanent) | 302 (Temporary) | |
|---|---|---|
| Tells search engines | “This URL has moved permanently — index the new one” | “This redirect is temporary — keep indexing the old URL” |
| SEO impact | Transfers link equity to new URL | Doesn’t transfer link equity |
| Browser caching | Cached aggressively (sometimes forever) | Re-checked on each visit |
| Use for | Permanent URL changes, domain moves | A/B tests, maintenance redirects, login redirects |
Default to 301 for almost everything. 302 is for genuinely temporary redirects that you’ll undo. The single most common mistake: using 302 when you mean 301, losing SEO value in the process.
Method 1: cPanel Redirects tool
- cPanel → Domains → Redirects.
- Type: Permanent (301) for nearly all use cases.
- Domain: pick from dropdown.
- Path slash + path: e.g.
/old-page. - Redirects to: full destination URL.
- Options:
- www. redirection: “Only redirect with www” / “Redirect with or without www” — usually pick the latter.
- Wild Card Redirect: redirects sub-paths too.
/old-section→/new-sectionwith wildcard sends/old-section/page1to/new-section/page1.
- Add.
cPanel writes the redirect to .htaccess automatically. Simple cases, low overhead.
Method 2: .htaccess directly
For more control, edit public_html/.htaccess (or the htaccess of the relevant directory). Add lines like:
Simple page redirect
Redirect 301 /old-page https://yourdomain.com/new-page
Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Force www (or non-www)
# Force www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# OR force non-www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [L,R=301]
Entire domain redirect
RewriteEngine On
RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301]
Bulk redirect via map
For many URL-to-URL mappings:
Redirect 301 /about /about-us
Redirect 301 /contact-us /contact
Redirect 301 /services/seo /seo-services
Redirect 301 /blog/old-post-1 /new-post-1
Order matters in .htaccess — more specific redirects must come before broader ones.
Method 3: WordPress plugin
For WordPress sites, “Redirection” plugin is the most popular — friendly UI, logs of redirects served, broken link tracking. Handles 301/302/307/308, regex matching, conditional redirects.
Plugin redirects happen at the PHP level (slightly slower than .htaccess), but the UI is significantly more manageable for sites with dozens of redirects.
SEO best practices
- Use 301 unless you specifically need 302. 301 transfers ~95% of link equity in current SEO consensus.
- Avoid redirect chains.
/a → /b → /c → /dwastes crawl budget and time. Make each redirect go directly to the final destination. - Map old URLs to relevant new URLs. Don’t redirect every old page to your homepage — Google sees this as a “soft 404” and treats it as link equity loss.
- Update internal links. If
/old-pageexists in your menu, blog posts, etc., update those links to point at/new-pagedirectly. Redirects are a safety net, not a primary navigation method. - Submit a new XML sitemap. Help Google find your new URLs faster.
- Check Google Search Console. Coverage reports show redirect issues.
Common redirect scenarios
Moving to a new domain
- Set up the new domain fully — all content live.
- On the OLD domain, add 301 redirect rule sending every URL to the matching URL on the new domain.
- Verify in Google Search Console: Settings → Change of address.
- Keep old domain active for at least 12 months (ideally indefinitely) so the 301s continue.
URL structure change (e.g. /post.php?id=123 → /blog/post-title)
- Use RewriteRule with regex pattern matching for the bulk transformation.
- Test each pattern with a few real URLs before deploying.
- WordPress plugin Redirection handles this cleanly via “Regex” option.
Maintenance page
- Use 302 or 503 (not 301) — you’ll be removing this redirect when site comes back.
- Better: serve a 503 status with a Retry-After header rather than redirecting.
Testing redirects
- Browser: visit the old URL, verify it lands at the new URL. Check the status code in DevTools → Network tab.
- Command line:
curl -I https://yourdomain.com/old-pageshows the status (look for “HTTP/1.1 301”) and the Location header. - Online testers: redirect-checker.org, httpstatus.io — enter URL, see the redirect chain.
Common redirect mistakes
“Redirect not working — site loads old URL.” Browser cache (especially aggressive on 301s). Test in incognito or clear cache. Server-side cache (Cloudflare, LiteSpeed) — purge it.
“Redirect loop — page keeps redirecting forever.” You have /a → /b AND /b → /a. Or your HTTPS redirect conflicts with Cloudflare’s “Flexible” SSL. Check your .htaccess and Cloudflare config.
“All my new URLs return 404 after the redirect.” Redirect points to non-existent pages. Verify the destination URLs actually exist on the new site.
“Lost SEO rankings after migration.” Usually means redirects weren’t set up properly. Audit: every old URL should 301 to a relevant new URL (not the homepage), and chains shouldn’t exceed 1 hop.
“WordPress redirect plugin and .htaccess fighting each other.” Pick one — using both creates conflicts. .htaccess is faster (server-level); plugin is easier (interface). For most WordPress sites with <50 redirects, plugin wins for manageability.
What’s next
- SSL and HTTPS redirects: SSL/AutoSSL guide.
- Domain-level moves: Migrating a domain.
- Diagnosing redirect issues from DNS: Domain not resolving.
Redirects are a small thing that quietly does enormous work — preserving SEO, keeping bookmarks valid, gracefully reorganizing URLs over years. Get the 301 vs 302 distinction right and the rest is just patient configuration.
Was this helpful?
Thanks for your feedback!