Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用预设路径重写iis 7 url_Url_Iis 7_Rewrite - Fatal编程技术网

使用预设路径重写iis 7 url

使用预设路径重写iis 7 url,url,iis-7,rewrite,Url,Iis 7,Rewrite,我正试图在iis 7或web配置中实现类似的功能 请求: products.aspx?id=100 重写: domain/products/mp3 请注意,我不想重定向,因为域/products/mp3是无效路径,我只想重写url,以便用户看到此路径,但服务器提供实际请求 您能帮忙吗?您能改用ASP.NET的URL重写功能吗?这就是为此而建的 RouteTable.Routes.MapPageRoute("Test", "domain/products/{type}", "~/products

我正试图在iis 7或web配置中实现类似的功能

请求:
products.aspx?id=100

重写:
domain/products/mp3

请注意,我不想重定向,因为
域/products/mp3
是无效路径,我只想重写url,以便用户看到此路径,但服务器提供实际请求


您能帮忙吗?

您能改用ASP.NET的URL重写功能吗?这就是为此而建的

 RouteTable.Routes.MapPageRoute("Test", "domain/products/{type}", "~/products.aspx");

然后,在products.aspx中,您必须以某种方式从mp3映射到100,但我假设您有一个db表用于此操作。

这必须是asp.net 4.0。我用的是3.5。有类似的吗?听起来好像从3.5开始就支持它了