Full domain to domain redirect with wildcard support

To divert a domain name to a new one, and include all wildcards, i.e, everything inserted after the / – you’ll need to do the following:

  1. Create a .htaccess file in the root of your website
  1. Populate the file as follows:

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

The /$1 at the end means if someone goes to olddomain.com/something it will take the /something and add it to the divert, taking you to newdomain.com/something

For support – please call us on 01473 561064