In short, I converted my old custom site to a new WordPress site, the domain remains same, I used PHP to insert thousands of old articles with its comments into WordPress database maintaining the same id sequence, meaning if the old links were:
www.mysite.com/index.php?id=11058
www.mysite.com/index.php?category=12
Than the new link are:
Everything was done well, the only problem is that I don't want to lose the old backlinks, and I want to use PHP to redirect, for example:
if (isset($_GET['old_id'])) { $id=$_GET['old_id']; $Wordpress_post_id = $id; }
How can I use this code in WordPress? and is this method better or redirect by .htaccess? Or is there another way that is better than the two?