Domain Redirect: 301, 302 and How to Configure in cPanel

Domains · 19.04.2026
Domain Redirect: 301, 302 and How to Configure in cPanel

A domain redirect automatically sends users and search bots from one URL to another. Choosing the right redirect type is critical to preserving SEO authority.

Redirect Types

CodeTypeSEOWhen to Use
301PermanentPasses ~99% authorityPermanent domain move
302TemporaryNo authority transferA/B tests, temporary promos

.htaccess Redirect Examples

# Redirect entire domain
RewriteEngine On
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]

# HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
💡 SEO tip: Pick one canonical domain version (www or non-www) and set up a 301 redirect from the other. Google should only index one version.
← Back to Knowledge Base Ask Support