看到网上很多人在关于UrlRewriter上花了很多时间,其实很简单,无外呼也就两种方法.
1.下载UrlRewriter.DLL组件
IIS服务器上,也有很多商业的ISAPI 筛选器模块可供使用
2.利用.NET的自带的类实现
首先设置WebConfig中的内容
拷贝 UrlRewriter_bin 重写类 中的DLL 到BIN文件夹内
使用相当方便
URL: http://localhost:2064/list/1.1/word/2.33/index.html
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![](/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![](/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>
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/None.gif)
8
![](/Images/OutliningIndicators/None.gif)
9
![](/Images/OutliningIndicators/None.gif)
10
![](/Images/OutliningIndicators/None.gif)
11
![](/Images/OutliningIndicators/None.gif)
12
![](/Images/OutliningIndicators/None.gif)
13
![](/Images/OutliningIndicators/None.gif)
14
![](/Images/OutliningIndicators/None.gif)
15
![](/Images/OutliningIndicators/None.gif)
16
![](/Images/OutliningIndicators/None.gif)
17
![](/Images/OutliningIndicators/None.gif)
18
![](/Images/OutliningIndicators/None.gif)
19
![](/Images/OutliningIndicators/None.gif)
20
![](/Images/OutliningIndicators/None.gif)
21
![](/Images/OutliningIndicators/None.gif)
22
![](/Images/OutliningIndicators/None.gif)
23
![](/Images/OutliningIndicators/None.gif)
24
![](/Images/OutliningIndicators/None.gif)
25
![](/Images/OutliningIndicators/None.gif)
26
![](/Images/OutliningIndicators/None.gif)
27
![](/Images/OutliningIndicators/None.gif)
28
![](/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;
下电影就上 挖沙啦电影网 - 更多免费高清电影下载