Havenswift Hosting Ltd
All guides

Redirects: 301, 302 and how to set them up

A redirect sends a visitor from one address to another. Choosing the wrong type quietly costs you search rankings.

301 or 302?

The common mistake is using 302 for a permanent move. The new address never inherits the ranking, and the old one gradually loses it because it no longer serves anything.

Doing it in cPanel

For a whole domain or a single page, use the Redirects tool. It writes the rule for you and is far safer than editing .htaccess by hand.

Doing it in .htaccess

A single page:

Redirect 301 /old-page.html https://www.example.com/new-page.html

A whole domain to another:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.old-domain\.com [NC]
RewriteRule ^(.*)$ https://www.new-domain.com/$1 [R=301,L]

Two things to watch

Other guides

Still stuck? Sign in and raise a ticket, and somebody will answer it.

Sign in