Last Updated: April 6, 2021 | Reading Time: < 1 minute
To redirect an entire old domain and all urls to a new domain, just paste the following code into the top of .htaccess file:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^olddomain.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.net/$1 [R=301,L]
The above code will redirect a url:
olddomain.com/about
to:
newdomain.com/about
Hopefully it helps.