Let us say I've got a domain: A.com, and when someone would go to A.com I wish to redirect to B.com.

But when they're going to the page on the.org, e.g. A.com/wordpress-admin/index.php, there won't be any redirect. In a nutshell, Among the finest an easy top level old title to new domain title 301 redirect. (Any sort of pages on the.org is going to be rerouted to a particular pages on B.com 1 by 1).

Here you decide to go:

RewriteEngine On

RewriteCond % =domain-one.com

RewriteRule ^$ http://domain-two.com/ [R=301,L]

  1. This rule will be put into .htaccess in website root folder. If placed elsewhere some small fine-tuning might be needed.

  2. It'll redirect hits to domain root only, e.g. http://domain-one.com/ with no other pages.

  3. I've changed A.com by domain-one.com and B.com by domain-two.com -- it's more realistic/understandable than A &lifier B.