在使用.Net 官方 Url重定向组件时,发现若原地址包含中文,如:http://localhost/首页.html 重定向为:http://localhost/index.aspx?id=首页  时,接收的中文参数为乱码,使用各种方法解决无果,发现一博友的解决方法有效:

https://www.cnblogs.com/simoncai/p/5711700.html

使用环境为:iis7+.net4.0。

解决完成后,重新配置IIS又花费了些时间,记录一下全部Web.config内容:

<?xml version="1.0" encoding="UTF-8"?>

<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
--> <configuration>
<configSections>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpModules>
<add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter" />
</httpModules>
</system.web> <system.webServer>
<!--解决集成通道无法使用问题-->
<validation validateIntegratedModeConfiguration="false" />
<defaultDocument>
<files>
<add value="index.aspx" />
</files>
</defaultDocument>
<handlers>
    <!--添加html脚本映射-->
<add name="rewriter" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
</handlers>
</system.webServer> <rewriter>
<!--重写规则-->
<rewrite url="^/(\d+).aspx$" to="~/index.aspx?id=$1" processing="stop" />
<rewrite url="^/(.+).html$" to="~/index.aspx?id=$1"/>
</rewriter> </configuration>

.Net Intelligencia.UrlRewriter 重定向参数中文支持配置方法的更多相关文章

  1. soapUI参数中文乱码问题解决方法 (groovy脚本中文乱码)

    soapUI参数中文乱码问题解决方法 可能方案1: 字体不支持中文,将字体修改即可: file-preferences-editor settings-select font 修改字体,改成能显示中文 ...

  2. soapUI参数中文乱码问题解决方法&soap UI工具进行web接口测试

    soapUI参数中文乱码问题解决方法 可能方案1: 字体不支持中文,将字体修改即可: file-preferences-editor settings-select font 修改字体,改成能显示中文 ...

  3. 在使用Intelligencia.UrlRewriter过程中 中文乱码问题

    由于业务需求,最近将项目部分模块修改为伪静态,使用到了Intelligencia.UrlRewriter.dll组件. 网上对使用Intelligencia.UrlRewriter.dll的配置讲解很 ...

  4. ubuntu texlive 中文的配置方法

    \documentclass[12pt]{article} \usepackage{CJKutf8} \usepackage{indentfirst}%设置第一段缩进,英语中从第二段才有缩进 \use ...

  5. ajax url参数中文乱码解决方法

    较好的处理办法,对js的url中的中文参数值使用两次encodeURI(),即encodeURI(encodeURI("url的中文参数值")) JS代码: var name=&q ...

  6. 给你的 CentOS 7 安装中文支持

    今天给大家分享个给 CentOS 7 安装中文支持的方法,所谓“中文支持”目前明月观测到的是指命令行提示支持中文提示显示,还有就是 Vim 启动后看到的也是有中文提是的界面包括 Vim 内各种提示也会 ...

  7. Intelligencia.UrlRewriter在IIS 7.0下的完全配置攻略

    在项目中,之前公司是使用IIS 7.0官方的URL重写模块,官方的使用说明请参见官方URLRewrite  ,添加伪静态支持,后来经理问我有没有涉及伪静态,我说之前项目中我一直是用Intelligen ...

  8. Nginx 配置参数中文说明

    Nginx配置参数中文详细说明: #定义Nginx运行的用户和用户组 user www www; # #nginx进程数,建议设置为等于CPU总核心数. worker_processes ; # #全 ...

  9. Nginx的配置参数中文说明

    Nginx的配置参数中文说明   前言 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,在BSD-like 协议下发行.其特点是占有内存少,并发能力强 ...

随机推荐

  1. WINFORM如何实现无聚焦框的Button按钮

    当我们将一个button按钮设置如下属性时,总有一个聚焦框来困扰着我们 button1.FlatStyle = FlatStyle.Flat; 我们想要的效果是这样的: 但当使用了Tab切换焦点时 发 ...

  2. 如何应用ASP.NET MVC中的分部视图

    概述: 在ASP.NET Web Form的开发经验中,对于User Control使用比较频繁,可以减少重复的代码,利于页面模块化,这个概念也被引入了ASP.NET MVC.即“分部视图”. 1.创 ...

  3. Laravel trait的使用

    trait 是在PHP5.4中为了方便代码复用的一种实现方式,但目前我在看的的PHP项目中较少看的有程序员去主动使用这个实现方式,在laravel中有很多 trait 的使用,关于trait 在 la ...

  4. Java设计模式浅谈

    1.java的设计模式可以分为3类: 创建型模式(5种):工厂模式,抽象工厂模式,建造者模式,单例模式,原型模式: 结构型模式(7种):适配器模式,装饰器模式,代理模式,外观模式,桥接模式,组合模式和 ...

  5. mysql update/delete in 子查询改写

    #子查询(不支持) limit ,); #改写 limit ,) t ; #子查询(不支持) delete from `user` where id in ( ) ); #改写 delete from ...

  6. HDU 1875(最小生成树)

    因为是全连接图,所以也可以用最小生成树 这道题给边加了一个限制条件,(10<=x<=1000),所以可能不能全连通,需要判断 #include <cstdio> #includ ...

  7. lumen配置日志daily模式

    默认的日志保存模式是single 也就是单文件模式 要想改成每日的daily模式可以在bootstrap/app.php下添加: /* * 配置日志文件为每日 */ $app->configur ...

  8. HTML5拖拽/拖放(drag & drop)详解

    H5中拖拽属性: draggable: auto | true | false   拖动事件:   - dragstart 在元素开始被拖动时触发 - dragend 在拖动操作完成时触发 - dra ...

  9. 1142 奖学金 sort做法

    个人博客:doubleq.win 1142 奖学金 2007年NOIP全国联赛普及组  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 白银 Silver 题解       题目 ...

  10. Uncaught TypeError: timeout.close is not a function. when try to use clearInterval

    It's because of your IDE! Make sure you have added automatic imports such as import { clearInterval ...