Redirect old domain to a new domain using .htaccess

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.

Looking for an affordable WordPress solution?

We offer budget-friendly WordPress website development services to meet your needs. Prices start at $10.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.