I have moved all content from an old domain to a new one, and I'd like the old site to redirect to the new.
I already have a root-to-root redirect set up using this code in the theme's index.php file:
header( 'Location: http://www.bayridgeodyssey.com/', true, 301);
I'd like to redirect all of the posts to their corresponding post on the new site, i.e.:
I would assume that there is some similar code I can add to single.php, but I don't know.
There are about 550 posts - I'd like to avoid doing something manual that lists each one, but it is possible.
Also, I want to make sure references to files (like JPG or PNG images) do not get redirected (I didn't transfer any of the old pictures).