301 Redirect For Apache Guide

Write to file called ‘.htaccess’. The file is named only as an extension. Hidden files must be viewable in the operating system. mod_rewrite must be enabled

Redirect a single file or directory to a new file or directory on a different domain
Redirect 301 /oldpage.html https://www.newdomain.com/ newpage.html

Redirect http://mysite.com to http://www.mysite.com. Affects entire domain

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule (.*) http://www.mysite.com/$1 [L,R=301

Redirect entire domain to a new domain as either a 301 (recommended) or 302
Entire site:
Redirect 301 / http://www.newdomain.com/
Redirect permanent /old http://www.newdomain.com/new