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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
Security Latest
Security Latest
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
S
Secure Thoughts
PCI Perspectives
PCI Perspectives
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
GbyAI
GbyAI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
罗磊的独立博客
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
V
V2EX
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tenable Blog
T
Threat Research - Cisco Blogs
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
Lohrmann on Cybersecurity
F
Full Disclosure
H
Help Net Security
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
A
Arctic Wolf
O
OpenAI News
S
Securelist

博客园 - 脑瓜子

博文阅读密码验证 - 博客园 开发 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上的。点击查看