Redirect a parked (alias) domain via htaccess (domain migration)

Sitebee

Technical SEO
Staff member
Here is the htaccess directive required to set a wildcard redirect on a parked (alias) domain. Useful for domain migrations or multiple parked domains on web hosting account/server. It also uses the SEO friendly 301 redirect.

Add the following to the htaccess file.
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain1.com$ [NC]
RewriteRule ^(.*) http://www.domain2.com/$1 [R=301,L]