StarDomain

Website Redirects — 301 vs 302

Website Redirects — 301 vs 302

Redirect visitors from one URL to another properly.

Redirect Types

CodeTypeWhen to Use
301PermanentPage permanently moved (SEO transfers)
302TemporaryPage temporarily moved (maintenance, A/B test)

Method 1: cPanel Redirects

  1. Go to Redirects in cPanel
  2. Select redirect type (301 or 302)
  3. Enter the source URL and destination
  4. Click Add

Method 2: .htaccess

Redirect single page

apache
Redirect 301 /old-page https://yourdomain.com/new-page

Redirect entire domain

apache
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ https://newdomain.com/$1 [R=301,L]

Redirect with pattern

apache
RedirectMatch 301 ^/blog/(.*)$ https://yourdomain.com/articles/$1

WordPress

  • Use Redirection plugin for managing redirects with a UI

SEO Impact

  • 301 redirects pass ~95% of link equity to the new URL
  • 302 redirects do NOT pass SEO value
  • Always use 301 for permanent changes
  • Update internal links to point to new URLs directly

Common Redirect Chains to Avoid

Avoid: http → https → www (two redirects)

Instead redirect directly: http → https://www (single redirect)