How to redirect an old domain to a new domain using htaccess?

You can redirect an old domain name to the new domain using htaccess file. This uses the 301 redirection that is SEO friendly.

# redirect from old domain to new domain

RewriteEngine On
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]

Put this code in your .htaccess file to redirect an old domain name to new domain name.

Posted by: - Sun, Mar 14, 2010. This article has been viewed 2528 times.
Online URL: https://www.articlediary.com/article/how-to-redirect-an-old-domain-to-a-new-domain-using-htaccess-393.html

Powered by PHPKB (Knowledge Base Software)