Redirect entire Wordpress Website to index page of New domain

Avatar
  • Answered
I need to redirect all my pages and posts of "olddomain.com" to index page of "newdomain.com" using .htaccess, I tried using the code: # BEGIN WordPress RewriteEngine On RewriteCond %{HTTP_HOST} ^olddomainn.com$ [OR] RewriteCond %{HTTP_HOST} ^www.olddomain.com$ RewriteRule (.*)$ https://newdomain.com/$1 [R=301,L] # END WordPress But it is redirecting to each page( ie, olddomain.com/about to newdomain.com/about ) but i need a code which can redirect all pages to index page of newdomain (olddomain.com/pages to newdomain.com ) . Please advice me what code i have to use in .htaccess file. Thanks Jinsy
Avatar
anonymous
Hello JinsyAbhilash, You could do this by performing a 301 redirect which is what you attempted to do but there is an easier way. Doing it via the guide I provided will redirect any url from olddomain.com to newdomain.com. Kindest Regards, TJ Edens