iis6|iis7|配置URLRewriter|64位操作系统下|.net2.0|.net4.0|配置URLRewriter|Web.config配置详情
想必很多ASP.NET的码友们在IIS配置伪静态被严重纠结过不止一次两次,本园主经过多次站点伪静态配置,总结了一下,IIS版本:IIS 6、IIS 7,服务器:Windows Server 2003、Windows Server 2008,开发机多半是Windows 7,站点.NET Framework 2.0、.NET Framework 4.0 ,随机搭配任意组合,时行时不行,完全靠运气以及人品,被虐千百遍之后,真是刻苦铭心闻者伤心见者也会流泪...
简单粗暴点吧,我认为直接帖上Web.config文件最实在
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/(\w*).html</LookFor>
<SendTo>~/Default.aspx?id=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/news-(\w*)_(\w*).html</LookFor>
<SendTo>~/Default.aspx?id=$1&tt=$2</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<!--<compilation debug="true" targetFramework="2.0" />-->
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
</httpHandlers>
</system.web>
<system.webServer>
<handlers> <!--.NET Framework 2.0 或 .NET Framework 4.0 二选一 -->
<!--.NET Framework 2.0 用这-->
<add name="woool1" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="woool" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
<!--64位操作系统就加上 ? -->
<add name="woool1_64" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="woool_64" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
<!--.NET Framework 2.0 用这结束--> <!--.NET Framework 4.0 用这开始-->
<add name="woool1" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="woool" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
<!--64位操作系统就加上 ? -->
<add name="woool1_64" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="woool_64" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
<!--.NET Framework 4.0 用这结束--> </handlers>
<!--iis 7.0 下支持 URLRewriter ? -->
<modules>
<add name="ModuleRewriter" type="URLRewriter.ModuleRewriter, URLRewriter"/>
</modules>
</system.webServer>
</configuration>
iis6|iis7|配置URLRewriter|64位操作系统下|.net2.0|.net4.0|配置URLRewriter|Web.config配置详情的更多相关文章
- 64位操作系统下IIS报“试图加载格式不正确的程序”错误
缘由:在64位操作系统下IIS发布32位的项目,报“项目依赖的dll无法读取,试图加载格式不正确的程序”错误. 原因:程序集之间的通讯要么全是64位环境下的,要么全是32位环境下的.不能混编访问.不然 ...
- Installshield 64位操作系统下拷贝文件,如何重定向到32位的系统文件夹下
原文:Installshield 64位操作系统下拷贝文件,如何重定向到32位的系统文件夹下 64位操作系统下拷贝文件重定向问题,在在复制代码前加上Disable(WOW64FSREDIRECTION ...
- Windows 64位操作系统下安装和配置MySQL
一安装方式 MySQL安装文件分为两种,一种是MSI格式的,一种是ZIP格式的.下面来看看这两种方式: MSI格式的可以直接点击安装,按照它给出的安装提示进行安装,Windows操作系统下一般MySQ ...
- (原)解决.NET 32位程序运行在64位操作系统下的兼容性问题
背景:一个第三方组件是C++.NET 32位开发的,后被C#(基于FrameWork4.0)调用并封装成组件,此二次封装的组件无法运行于64位操作系统上. 开发环境:VS2012:解决 ...
- [转]解决win7 64位操作系统下安装PL/SQL后连接报错问题: make sure you have the 32 bits oracle client installed
1. 在Oracle官网(http://www.oracle.com/technetwork/topics/winsoft-085727.html)下载文件: instantclient-basic- ...
- 解决win7 64位操作系统下安装PL/SQL后连接报错问题: make sure you have the 32 bits oracle client installed
1. 在Oracle官网(http://www.oracle.com/technetwork/topics/winsoft-085727.html)下载文件: instantclient-basic- ...
- 64位操作系统下调用32位com的问题
Hello Guys! I am trying to create a simple VBS script to automatically open some .tif images from a ...
- Windows 10 64位操作系统 下安装、配置、启动、登录、连接测试oracle 11g
一.下载oracle安装包 1:详细下载安装版本可见官网:https://www.oracle.com/technetwork/database/enterprise-edition/download ...
- 解决64位操作系统下运行psql的问题
我的机器环境是 win7 64位.正常情况下,只需要安装plsql 和 oracle client,配置好 tnsname.ora 就能正常访问数据库.实际上遇到了几个问题. 1. 在tnsnames ...
随机推荐
- Finish 和 Complete 的区别
2012年,在伦敦举行的语言大赛中,圭亚那选手Samsunder Balgobin 在回答比赛中最后一道问题 "你如何用一种容易让人理解的方式解释 complete与finished 的区別"时, ...
- oracle 几个不常用的关键字
ntile (n)是分析函数,n是吧窗体的数据分成几组. sys_connect_by_path 用来列转行 connect_by_isleaf 判断层级查询是否为叶子节点. siblings 用来层 ...
- VPN服务器是什么?
可能很多人听到VPN的第一感觉是它是一个FQ的工具,然而并不是酱紫的. 虚拟专用网(Virtual Private Network,简称VPN),是一种常用于连接中.大型企业或团体与团体间的私人网络的 ...
- Windows上Python2和3如何兼容
作者:匿名用户链接:https://www.zhihu.com/question/21653286/answer/95532074来源:知乎著作权归作者所有,转载请联系作者获得授权.想学习Python ...
- Java基础---MD5和BASE64
package cn.peter; import sun.misc.BASE64Encoder; import java.io.UnsupportedEncodingException; import ...
- 定义/修改列时 NULL
mysql的文档说明: column_definition: col_name type [NOT NULL | NULL] [DEFAULT default_value] [ ...
- [C#][.net 4]Task 代码示例
using System; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; name ...
- iOS实现类似于歌词进度效果
先看效果 这里关键的地方在于镂空文字的实现,可以用UILabel的drawRect方法. .h文件 @interface HollowLabel : UILabel @end .m文件 @interf ...
- 约瑟夫环问题(c++)
#include <iostream> struct node{ int payload; node* next; node(int payload){this->payload = ...
- Robot Framework入门学习2 创建第一个测试用例
本文章部分内容引自以下网址,感谢作者的辛苦分享 http://www.cnblogs.com/fnng/p/3871712.html http://blog.csdn.net/tulituqi/art ...