The Scenario
I have completely rewritten an old existing ASP classic ecommerce website over to PHP.
The database design of the previous site had alot of relational ID problems causing troublesome linking of product data rows to other tables in the database.
To get around this I also redesigned the database, giving products new Primary Keys, whilst still keeping a column in the table with the products old PK.
The Problem
The problem I have is when the site is relaunched, I need all search engine links that used to point to 'Product.asp?ProductID=29' to lookup the the database, match the products old PK, and redirect to the products new PK i.e. 'Products.php?ID=53'.
I'm looking to do this with Mod_ReWrite/ReWriteMap, however, all documentation I can find online doesn't state how to deal with the database script PK lookup.
Update
I've read up further on Ignacio Vazquez-Abrams' suggestion at http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritemap > External Rewriting Program, and it seems to be correct and the ideal solution.
However, after contacting my host, they do not enable ReWriteMap
on their servers.
I've supplied my own, but by no means the best/correct solution of achieving this without ReWriteMap
enabled.