IIS 8 URL重写:可能在一个规则中返回不同的结果?

Windows Server 2012, IIS 8; running a combination of Classic ASP and PHP.

I think I already know the answer to this one, but just in case I'm not as smart as I think I am...

I've got a car dealership client who has created a separate page for every make/model combination they offer, ~48 pages. They would like each one pointed to with a friendly URL, e.g.

theirSite.com/shop-chevrolet-camaro-inventory 

=

index.php?p=123. 

This means creating 48 separate rewrite rules, and while there's nothing inherently wrong with that, it bugs me to death. Had they consulted me, first, I would have advised them to create each of these as a template file, and I would have written a program to load them dynamically, using one page and one rewrite rule.

So, it is possible for the rewrite rule to somehow dictate a piece of the rewrite result? Taking

/shop-chevrolet-camaro

where camaro translates to page 123; corvette translates to page 124; cruze translates to 125; and so on? For SEO purposes, I can't point to an intermediate page and introduce a redirect, we have to hit the destination page directly as a rewrite.

Am I out of luck?

I think that you probably still can go with your idea here of just one page and one .htaccess redirect; Just a little different approach.

You can probably use include to bring their data from one of the 48 pages and display it on your "master" page. Now, to figure out which page to pull in, I wrote an answer to a similar question here:

https://stackoverflow.com/a/21714410/3293987

Hopefully this helps you. The basic premise is to take the "friendly" name (as it is appearing in the .htaccess and pass that to the script instead of the id number. Then, in your script, you'd do a lookup by the "friendly" name instead of the id. Then you can programmatically find which page needs loaded and use PHP's include to pull in the data.

As far as your concern of having an intermediate page for the redirect, you should not need to do a redirect with this solution; You can just load the data from the existing "peripheral" page on to the "master" page.

I hope that answer helps you.