I'm currently moving all pages and content for my website to an assortment of other sites. The old will become a portal which directs users in the right direction.
Since pages are going to be removed, it is likely that a number of links will return the 404.php file in my theme. I need a way of conditionally redirecting users to the correct page on the new websites. I was thinking something like this*, however it is a little bit messy. Are there any more effective ways of doing it?
Thanks for any help or pointers.
*I've excluded theme code, obviously