The Scenario
I have completely rewritten an old existing ASP classic ecommerce website over to PHP.
The database design of the previous site had
After finding out RewriteMap is disabled by my host, I've reached my own solution simply using mod_rewrite and 2x 301 redirects.
.htaccess file
RewriteEngine on
RewriteRule ^Product(.*)\.asp SEO_Redirect.php [NC,R=301]
SEO_Redirect.php file
$ID = $_GET['ID'];
$query_rsNewID = "SELECT NewProductID FROM Products WHERE OldProductID = '$ID'";
$rsNewID = mysql_query($query_rsNewID, $Database);
$row_rsNewID = mysql_fetch_assoc($rsNewID);
header ('HTTP/1.1 301 Moved Permanently');
header ('Location: Product.php?ID='.$row_rsNewID['NewProductID']);
Note, this is a simplified excerpt of each file, and would not be secure against SQL injection.
Hopefully Google and alike will accept getting 2x 301 redirects without problems.