Personal Blog

How do I redirect my entire domain from one domain to another with a 301 Permanent Redirect using htaccess

The short answer

RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]