how to do 301 redirects from old site to new

I have a website which is on Wordpress www.old.example.com and on its own IP/Server 10.1.1.1

It has various pages which are ranked on google which I'd like to preserve.

I have a new website www.new.example.com which is configured using APACHE2 Vhosts and is also on its own IP/Server 10.2.2.2

How do I do 301 redirects? Do I do the 301 redirects in Wordpress on www.old.example.com or do I change its IP address to point to the new server and then do the redirects in the www.new.example.com .conf file?


Solution 1:

Either way works fine. First one is easier, you can just add the redirects.

Using the second option requires you to set up virtual hosts on the new server.