<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[Heck's  Blog]]></title> 
<link>https://www.heckjj.com/index.php</link> 
<description><![CDATA[一瞬间的决定，往往可以改变很多，事实上，让自己成功的往往不是知识，是精神！ 如果你总是为自己找借口，那只好让成功推迟。执行力，今天！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[Heck's  Blog]]></copyright>
<item>
<link>https://www.heckjj.com/IIS-UrlRewrite-technology-test-html/</link>
<title><![CDATA[浅谈IIS下的UrlRewrite技术]]></title> 
<author>Heck &lt;@hecks.tk&gt;</author>
<category><![CDATA[编程杂谈]]></category>
<pubDate>Sun, 26 Sep 2010 00:10:49 +0000</pubDate> 
<guid>https://www.heckjj.com/IIS-UrlRewrite-technology-test-html/</guid> 
<description>
<![CDATA[ 
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 微软雅黑;">今天有个同事提到了UrlRewrite技术，晚上研究了下，把它写出来和大家分享下。UrlRewrite即地址变换。它可以实现静态功能方便搜索引擎收录，比如http://***/news.asp?id=11它可以变为htt://***/news-11.html。这样还实现了开发标记隐藏，避免了每个页面都挂了.asp、.php等后缀，提高了网站的安全性。 <br/><br/>IIS默认是不支持这个功能的，需要单独安装插件，今天网上看了很多教程，综合起来加上自己研究才终于把它试成功了。测试环境：Windows XP IIS 5.0。 <br/><br/>我们第一步做的是下载IIS UrlRewrite插件，到http://www.helicontech.com/download-isapi_rewrite3.htm下一个ISAPI_Rewrite 3 Lite installation package（精简版）的测试就满足了（根据你自己）。下载好后安装ISAPI_Rewrite3_0048_Lite.msi。 <br/><br/>安装完毕后打开IIS，在WEB属性的“ISAPI筛选器”里添加位于安装目录的Helicon&#92;ISAPI_Rewrite3文件夹里的ISAPI_Rewrite.dll，名称就随便定了，如图： <br/><a href="https://www.heckjj.com/attachment.php?fid=76" target="_blank"><img src="https://www.heckjj.com/attachment.php?fid=76" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a> </span><span style="font-family: 微软雅黑;"><br/>然后我到源码之家随便下载了一个ASP的文章管理系统。<br/><br/>运行位于安装目录的Helicon&#92;ISAPI_Rewrite3文件夹里的Helicon Manager.exe编辑正则表达式，打开后点击“Edit”按钮，在里面输入正则表达式，至于正则表达式怎么写在这里不多提了，有兴趣的参考ISAPI_Rewrite.chm帮助文件（英文的）或者在百度里找相关的文章。我就在这里提供一个正则表达式吧。输入以下表达式： <br/>RewriteRule /onews-([0-9,a-z]*).html /网站路径/onews.asp&#92;?id=$1 <br/>解释一下表达式：/onews-([0-9,a-z]*).html就是页面的格式，其中onews是onews.asp的扩展名前的名称，就是将onews.asp?id=12转成onews-12.htm这样的；/网站路径/onews.asp&#92;?id=$1中的网站路径就是网站存放的路径，如果在默认的WEB目录下就不用填，如果在默认WEB目录的文件夹里需要填，比如我的WEB位于c:&#92;inetpub&#92;wwwroot&#92;test目录里，那么就填成/test/onews.asp&#92;?id=$1。onews.asp就是显示文章的文件，id=$1就是参数，比如网站新闻显示地址参数是onews.asp?id=12这样的格式，那么id就是id=12的那个参数，根据程序本身来填。之后点击“Apply”按钮或者按下快捷键Ctrl S。 <br/><br/>打开浏览器，输入http://127.0.0.1/test/onews-12.html（根据自己的程序改地址）看看效果，如图： <br/><a href="https://www.heckjj.com/attachment.php?fid=77" target="_blank"><img src="https://www.heckjj.com/attachment.php?fid=77" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/></span><br/>Tags - <a href="https://www.heckjj.com/tags/iis/" rel="tag">iis</a> , <a href="https://www.heckjj.com/tags/urlrewrite/" rel="tag">urlrewrite</a>
]]>
</description>
</item><item>
<link>https://www.heckjj.com/IIS-UrlRewrite-technology-test-html/#blogcomment</link>
<title><![CDATA[[评论] 浅谈IIS下的UrlRewrite技术]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://www.heckjj.com/IIS-UrlRewrite-technology-test-html/#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>