How to redirect old domain and all sub pages to new domain using htaccess

Professional and affordable website design. Based in King's Lynn, Norfolk.

How to redirect old domain and all sub pages to new domain using htaccess

If you have an old site and are looking to redirect the entire site to a new URL then simply put this in an .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} old\.com$
RewriteRule .* http://www.new.com/? [L,R=301]

Leave a Reply

Your email address will not be published. Required fields are marked *