简体   繁体   中英

IIS7 Url rewriting without code modification

I am looking in to implementing Url rewriting for our site, using the rewrite module 2.0. currently our urls look like: http://www.example.com/NewChannels/Channel.aspx?ChannelId=4 I want to make this in to http://www.example.com/4/

I got this working, but since many things on the page (background colors, font colors, etc.) use the querystring, they break. I don`t want to go into the code and change these to use the special server variables. Is there any way of implementing this that does not require code modification?

you have two simple ways to get it, Use the urlrewrite module or develop your module to do this as you wish.

take a look to this Link for Urlrewrite Module: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

Creating your own module, pay attention to thins method: httpapplication.Context.RewritePath

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