使用数据库变量重写IIS 7 URL [英] IIS 7 url rewrite using database variables
问题描述
我想从 http://www.example.com/更改我的网址product.asp?productid = 30
到:
http:// www。 example.com/Samsung_LED_UE40D5000
Samsung_LED_UE40D5000是产品名称+存储在数据库中的产品型号,并与productid关联为主键。 / p>
我如何编写url重写规则来实现?
非常感谢!
OB
您必须编写 Custom Rewrite Provider (自定义重写提供程序),该访问数据库可将产品名称+产品型号解析为productId。然后在重写规则中使用此提供程序。
此处是描述该过程的文档。
I would like to change my urls from http://www.example.com/product.asp?productid=30 to: http://www.example.com/Samsung_LED_UE40D5000
the Samsung_LED_UE40D5000 is the product name + the product model stored in the database and is associated with the productid as the primary key.
how do i write a url rewrite rule to achieve that? Thanks a lot!
O.B
You have to write Custom Rewrite Provider which accesses database to resolve product name + the product model to productId. Then use this Provider in your rewrite rules.
Here is document describing the process.
这篇关于使用数据库变量重写IIS 7 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!