Here you will know about possible ways to set 301 redirect by .htaccess file. To change .htaccess file, perform the following steps:
Step 2. Go to Domains management section
Step 3. Select the website where you want to set 301 redirect.
Step 4. Go to file manager
Step 5. Select the directory of your website and find .htaccess file there.
If there is no such file, create it.
301 redirect from HTTP domain to HTTPS domain
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
301 redirect from WWW domain to domain without WWW
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.site\.com$ [NC]
RewriteRule ^(.*)$ http://site.com/$1 [R=301,L]
Enter the domain of your website instead of ‘site.com’.
redirect from domain without WWW to WWW domain
RewriteEngine On
RewriteCond %{HTTP_HOST} ^site\.com$ [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,L]
301 redirect from one domain to another
RewriteEngine On
RewriteCond %{HTTP_HOST} domain1.ua
RewriteRule (.*) http://domain2.ua/$1 [R=301,L]