How Do I Redirect a WordPress Site?

There are a few ways to redirect a WordPress site. One way is to use thehtaccess file. To redirect a WordPress site, you would add the following code to yourhtaccess file:

# Redirect www.example.

com to www.newsite.com.

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^www.com$ [NC]

RewriteRule ^ http://newsite.com/$1 [R,L]

The above code will redirect www.com to www. Note that you must use [NC] in the RewriteCond statement to indicate that the www.

example.com domain should not be redirected. If you do not include this statement, the www.com domain will be redirected.