简体   繁体   中英

iis 7 url rewrite with preset paths

I'm trying to make something like this work in iis 7, or web config

request: products.aspx?id=100

rewrite: domain/products/mp3

Please note, I do not want redirection, for domain/products/mp3 is invalid path, I just want the url rewrite so the user sees this path but the server serves the actual request.

Can you help?

Can you use the URL Rewrite functionality from ASP.NET instead? That was built for that.

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

Then in products.aspx you have to map from mp3 to 100 somehow, but I assume you have a db table for that anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM