看到网上很多人在关于UrlRewriter上花了很多时间,其实很简单,无外呼也就两种方法.
1.下载UrlRewriter.DLL组件
IIS服务器上,也有很多商业的ISAPI 筛选器模块可供使用
2.利用.NET的自带的类实现
首先设置WebConfig中的内容
1
<?xml version="1.0"?>
2
<configuration>
3
<configSections>
4
<section name="CustomConfiguration" type="URLRewriter.Config.UrlsSection, URLRewriter" />
5
</configSections>
6![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
<CustomConfiguration>
8
<urls>
9
<add virtualUrl="~/list/(\d+)" destinationUrl="~/default.aspx?list=$1" />
10
<add virtualUrl="~/list/(\d+)/" destinationUrl="~/default.aspx?list=$1" />
11
<add virtualUrl="~/list/(\d+)/index.html" destinationUrl="~/default.aspx?list=$1" />
12
<add virtualUrl="~/word/(\d+)/index.html" destinationUrl="~/default.aspx?word=$1" />
13
<add virtualUrl="~/list/(.*)/word/(.*)/index.html" destinationUrl="~/default.aspx?list=$1&word=$2" />
14
15
<add virtualUrl="~/microsoft*.*" destinationUrl="~/default.aspx" />
16
<add virtualUrl="~/microsoft*" destinationUrl="~/default.aspx" />
17
<add virtualUrl="~/m/i/c/rosoft.aspx" destinationUrl="~/default.aspx" />
18
<add virtualUrl="~/m/i/c/*" destinationUrl="~/default.aspx" />
19
</urls>
20
</CustomConfiguration>
21![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
22
<system.web>
23
<httpModules>
24
<add type="URLRewriter.RewriterModule, URLRewriter" name="RewriterModule"/>
25
</httpModules>
26
<authentication mode="Forms"/>
27
</system.web>
28
</configuration>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
24
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
25
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
26
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
27
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
28
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
拷贝 UrlRewriter_bin 重写类 中的DLL 到BIN文件夹内
使用相当方便
URL: http://localhost:2064/list/1.1/word/2.33/index.html
/list/1.1/word/2.33/index.html
第0个Key=list,value=1.1;第1个Key=word,value=2.33;
第0个Key=list,value=1.1;第1个Key=word,value=2.33;
下电影就上 挖沙啦电影网 - 更多免费高清电影下载