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
精彩评论