301 redirect all traffic from domain A to the root of domain B

If you need to 301 redirect all the traffic from olddomain.com to the index page of newdomain.com then add the following code to your root .htaccess page on olddomain.com

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) https://www.newdomain.com [R=301,L]

Any traffic from any part of olddomain.com will now go to the home page of newdomain.com

  • 301 redirect
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Solving the ERR_BLOCKED_BY_XSS_AUDITOR in Chrome

You are reading this article because you have saved something in wordpress and received an error...

Additional security/performance settings for htaccess

Below is some additional rules for your htaccess file which provides some performance and...

Forcing SSL and WWW in htaccess

Use the following code in the htaccess file for making sure that all pages served up are www and...

Fix WordPress 404 Errors on Password Protected Directories

You are reading this article becasue you have applied password protection on the wp-admin...

301 redirect all traffic to new site except for certain folders

If you need to redirect a whole site to a new url except for one or more folders, then the script...