You should be able to specify something like http://www.mydomain.com/oempartnumber/oem and http://www.mydomain.com/mypartnumber/pn. There must be something in the url that allows you to choose the controller you want to use and further more allow you to distinguish between a part number and an oem part number (unless those are also unique against one another. If there will never be overlap between oem and pn then you could have http://www.mydomain.com/{partnumber}/pn.
RouteTable.Routes.Add(new Route
{
Url = "[query]/pn",
Defaults = new { controller="PartNumber", action = "Details" },
RouteHandler = typeof(MvcRouteHanderl)
});
You could use some trickery with a route like this:
routes.MapRoute(
"Part number",
"{partNumber}",
new { controller = "Part", action = "Display" },
new
{
partNumber = @"\d+" // part number must be numeric
}
);
But the problem here is that an OEM part number that is not actually a part number (such as "ave-345") would not match!
UPDATE: In reading I noticed that you said "this is not an MVC site so I don't have controllers!"...OH! That changes things. In that case you can check to see if the directory exists where you pass in http://www.mydomain.com/1234 and if not you can test it for a product number. This would have to be done in a HttpModule though so you can catch it before your page is executed. Then on the server side you can direct the page to http://www.domain.com/productdetails?pid=1234.
Take a look here to understand that: http://www.15seconds.com/Issue/020417.htm
For this you will have a class that inherits from IHttpModule. Then you can specify an Init method
public void Init(HttpApplication application)
{
//let's register our event handler
application.PostResolveRequestCache +=
(new EventHandler(this.Application_OnAfterProcess));
}
This then points to your Applicaton_OnAfterProcess method:
private void Application_OnAfterProcess(object source, EventArgs e)
{
HttpApplication application = (HttpApplication)source;
HttpContext context = application.Context;
...
Inside of here you can specify some rules about what you are looking for.
I usually do something along the lines of
if (!System.IO.File.Exists(application.Request.PhysicalPath)) //doesn't exist
{
//you test for your product ID here
...
//if you find it stuff it into a ProductID variable for later...
Once you isolate your product ID you can then rewrite the URL (server side) and direct the user to the proper productDetails.aspx page.
context.RewritePath("~/products/productDetails.aspx?ProductID=" + ProductID.ToString());
So while the user and google sees http://www.mydomain.com/1234 your application will see http://www.mydomain.com/products/productdetails.aspx?productid=1234 and you can code against it as usual.
I hope this is what you were looking for instead!