惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Troy Hunt's Blog
Latest news
Latest news
Vercel News
Vercel News
S
SegmentFault 最新的问题
V
Vulnerabilities – Threatpost
博客园 - Franky
P
Privacy International News Feed
A
Arctic Wolf
T
The Blog of Author Tim Ferriss
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Tor Project blog
Jina AI
Jina AI
GbyAI
GbyAI
The Hacker News
The Hacker News
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
T
Threatpost
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Scott Helme
Scott Helme
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Microsoft Azure Blog
Microsoft Azure Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 司徒正美
A
About on SuperTechFans
Recorded Future
Recorded Future
爱范儿
爱范儿
L
LangChain Blog
V
V2EX
C
Cybersecurity and Infrastructure Security Agency CISA
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
D
DataBreaches.Net
宝玉的分享
宝玉的分享
Google Online Security Blog
Google Online Security Blog
C
Cisco Blogs
L
Lohrmann on Cybersecurity
Help Net Security
Help Net Security
AWS News Blog
AWS News Blog
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY

博客园 - 眼里进了砂

Unity Application Block 1.2 学习笔记 [转] Unity Application Block 與 ASP.NET MVC 學習資源整理 [转] 线程之间的通讯---SynchronizationContext [转] .NET2.0中WinForm自定义的程序配置[转] 使用BackgroundWorker组件进行异步操作编程[转] .NET页面事件执行顺序[转] 利用XPath读取Xml文件 javascript中replace与正则表达式 c# BackgroundWorker组件介绍(属性、方法、事件) .net 2.0 BackgroundWorker类详细用法 .Net的线程同步方法一:ManualResetEvent .NET应用程序中异步调用Web Service的几种方法 come from: veryhappy(wx.net) [转][javascript] Google谷歌首页点点效果 AJAX 中Sys.WebForms.PageRequestManager的事件激发顺序 AJAX 中Sys.Net.WebRequestManager的事件激发顺序 Summary review about Problem.Design.Solution 2 Summary review about Problem.Design.Solution [转发]深入理解 __doPostBack CSS Tips
不用设置iis .net 实现urlrewrite[转]
眼里进了砂 · 2009-05-14 · via 博客园 - 眼里进了砂

说到不用设置iis,主要是为了实现在虚拟主机或是拿不到iis操作限的时候,不能添加isap又想实现类似于静态化的程序实现方式,先声明,这里最终要实现的效果是,最终可以用
12345.aspx替换
show.aspx?id=12345这样的地址访问

程序要调整的部分只有两块。
一是web.config文件。
二是链接地址。
所需dll。urlrewrite.dll

好了开始实施。
第一步:将urlrewrite.dll下载到你的web程序目录里去。哪都行。我是放在bin里面的。然后添加引用。在整个程序上添加引用。将urlrewrite.dll引用进来。
第二步:修改web.config
这一步要修改两个地方。要注意位置是不同的

1、
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/(\d+)\.(aspx|html)</LookFor>
<SendTo>~/show.aspx?id=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/news(\d+)\.(aspx|html)</LookFor>
<SendTo>~/ShowNews.aspx?newsid=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
这一段要添加在<configuration>的下面。<connectionStrings/> <system.web>的上面。
2、
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
这段要添加在<system.web>的下面。OK。保存。位置要搞清楚。

要不然效果可实现不了。

现在去建立一个页面。为show.aspx然后在里面写个response.write这样的把url里面的id写出来。这个不用讲就会了吧。看到这里连这个都不会就不会看这篇文章了。看了也白看。
先用show.aspx?id=1234打开。保存页面里面显示的是1234
然后再去试试用1234.aspx。看到什么了?如果还是1234的话就恭喜你成功了。