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

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

博客园 - 脑瓜子

博文阅读密码验证 - 博客园 开发 SQLite学习手册(转) 缓存数据库redis、memcached。 MongoDB 资源集锦 在GOOGLE浏览器中模拟移动浏览器 调试Web app 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 脑瓜子的文章导航 脑瓜子的学院系列文章汇总 博文阅读密码验证 - 博客园 ASP.NET中上传图片检测其是否为真实的图片 防范病毒上传至服务器 ASP.NET MVC 中实现View与Controller分离 [开源]C#中开源软件大汇总(外国的) 百度知道回答内容呈现给大家分享下 团购网是否能拯救那些因为运费问题而滞销的农产品? 个人的用户体验感想+点评jobily 发的日志 作为一个技术人员,终于有了自己的第一个作品 博文阅读密码验证 - 博客园 HttpHandler(ashx)中获取Session状态 - 脑瓜子 - 博客园
Intelligencia.UrlRewriter在IIS 7.0下的完全配置攻略
脑瓜子 · 2014-02-15 · via 博客园 - 脑瓜子

在项目中,之前公司是使用IIS 7.0官方的URL重写模块,官方的使用说明请参见官方URLRewrite  ,添加伪静态支持,后来经理问我有没有涉及伪静态,我说之前项目中我一直是用Intelligencia.UrlRewriter,我觉得它蛮好用的,然后我就按领导的意思换成这个,我以为这东西最多半个小时就搞定的事情,我之前都是在IIS 6.0上配置的。找过一些资料发现是webconfig中,多加两个配置。我在此记录下来。以便今后使用。

1、在modules 结点添加runAllManagedModulesForAllRequests属性

<modules runAllManagedModulesForAllRequests="true">

2、然后在modules结果添加以下配置

<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule"/>

下面完整的介绍下配置步骤:

一、配置webconfig

第一步:在配置文件configSections结点中添加下面配置:

<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>

第二步:在httpModules结点内添加如下配置

<!--配置url重写指定具体的处理组件-->

<add type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" name="UrlRewriter"/>

第三步:在modules 结点添加runAllManagedModulesForAllRequests属性

<modules runAllManagedModulesForAllRequests="true">

第四步:在modules结果添加以下配置

<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule"/>

重写规则的配置:有两种配置,一种是直接写在webconfig中,一种是写到一个xml中

1、在webconfig中的配置:

<rewriter>
    <rewrite url="~/default.html$" to="~/default.aspx" processing="stop" />
    <rewrtie url="^~/(\d+)/(\d+).html" to="~/Default.aspx?id=$1&amp;artcleid=$2" />//多个参数

</rewriter>

2、写到一个xml文件中,这样需要的webconfig指定到xml中

如:

<!--地址重写规则-->
  <rewriter file="~/xml/config/rewrite.xml"/>

rewrite.xml中的内容如下:

<?xml version="1.0" encoding="utf-8" ?>
 <rewriteRules>
   <!--注册日志监视器-->
   <register logger="Intelligencia.UrlRewriter.Logging.DebugLogger, Intelligencia.UrlRewriter" /> 
   <!--begin 网站首页 -->

  <rewrite url="~/index.html" to="~/Price_index.aspx" />
   <!--end 网站首页 -->
   <!--begin 新闻列表1(新闻类型) -->
   <rewrite url="~/newslist/([^/]*)/?$" to="~/price_newlist.aspx?type=$2" />
   <!--end 新闻列表1(新闻类型) -->
   <!--begin 新闻列表2(含分页) -->
   <rewrite url="~/newslist/([^/]*)-(\d{1,3})/?$" to="~/price_newlist.aspx?type=$1&amp;page=$2" />
   <!--end 新闻列表2(含分页) -->
 </rewriteRules>

到此介绍完毕,也许大家可能在用到这个的时候会遇到一个问题,那就是项目中本身的html文件无法访问,下次我为大家一一介绍解决办法。看到有需要用到的就参考下。

这篇文章是在2012-06-09发表在csdn上的。点击查看