htaccess 301 redirect tutorial

RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?domain.com [NC] RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^(www.)?domain.net [NC] RewriteRule ^(.*)$ https://www.domain.com/path/$1 [R=301,L]