Lets assume you have something like:
http://www.example.com/index.php?product=111&date=2000-01-01&category=222
and you want to have a more uniform and informative url scheme such as
http://www.example.com/camping/bigtent
You first need to determine what needs to be in the url for your program to understand how deliver the proper information. Does the date need to be in the url? Does the category information?
If you wrote your program so that there were unique database identifiers such as absolutely unique product numbers then you can simply read the old url and then look for the product number and redirect the visitor to the correct url.
Lets also assume you have constructed the database so that you can find which category any given product belongs to. This may not be the case if you have floating categories or do not use categories, in which case you are not concerned with that information.
function readurl(){// global $_GET; or $productid = $_GET['product'];// read the url and find the product variable// find the product information in the database using the variable// reconstruct the url and use a 301 redirect to make sure you tell search engines that the old url has moved permanently// info from database
$categoryname = from database;$productname = from database;
$newurl = "http://www.example.com/$categoryname/$productname";
$x = Header("HTTP/1.1 301 Moved Permanently");
$x .= Header("Location: $newurl"); return($x);
}