Set Up URL Redirects (301 & 302) Print

  • 0

A redirect sends visitors from one URL to another. A 301 redirect is permanent. A 302 redirect is temporary.

Use cPanel's Redirect Tool

  1. Log into cPanel.
  2. In the Domains section, click Redirects.
  3. Select the type:
    • Permanent (301) - use when moving a page permanently.
    • Temporary (302) - use for maintenance or temporary changes.
  4. Choose the domain and enter the path to redirect from.
  5. Enter the destination URL (where visitors should go).
  6. Select Wild Card Redirect if you want to redirect all files in a directory.
  7. Click Add.

Use .htaccess

Add this to your .htaccess file for a 301 redirect:

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

Or to redirect an entire domain:

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

Was this answer helpful?

« Back