You are here

Redirect old domain to new domain using .htaccess

Here's a quick snippet of code to keep around if you ever migrate from an old domain to a new domain.

Shown here is what I used to move to

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^$
RewriteRule (.*)$$1 [R=301,L]

This not only redirects to from but also bumps off the www. subdomain

Submitted by brant on Thu, 05/10/2012 - 15:30