create new htacces with redirect 301 code example
Example 1: htaccess redirect to https
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^yourdomain\.com [OR]
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com
RewriteRule .* https://yourdomain.com%{REQUEST_URI} [R=301,L]
Example 2: 301 redirect htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ http://domain2.com/$1 [L,R=301,NC]