HostOnNet Blog

Redirect OLD domain to NEW using .htaccess

Looking for Linux Server Admin or WordPress Expert? We can help.

When you move your web site form one domain to another, you need to redirect all visitors on your old domain to new one to avoid lose of traffic. Google recommend using 301 redirect when you change URL of a web page.

To do this create .htaccess file with following content.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^$
RewriteRule (.*)$$1 [R=301,L]

If you only need to redirect few page on your web site, use Redirect option.

Redirect 301 /old-page.html

See Htaccess Tips and Tricks

Posted in Apache

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.