How to set up a redirect in cPanel
- Open "Redirects" (group "Domains").
- "Type" - "Permanent (301)" for a permanent move, "Temporary (302)" for a while.
- Select the domain. "** All Public Domains **" applies to all domains of the account.
- In the field after
/, enter the old page, for exampleold-page.html. Leave it empty to redirect the whole domain. - In "Redirects to", enter the full new address, for example
https://example.com/new-page/. - "www. redirection" - usually "Redirect with or without www.".
- Click "Add".

The redirect appears under "Current Redirects". The panel writes it to .htaccess in the site folder.
With .htaccess
Redirect 301 /old-page.html https://example.com/new-page/Redirect the whole site to a new domain keeping page addresses:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com$ [NC]
RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301]The https redirect is a separate switch: HTTPS redirect.