URL Rewrite Module Configuration Reference-程序员宅基地

技术标签: ui  php  c/c++  

About the URL Rewrite module

The Microsoft URL Rewrite Module 2.0 for IIS 7 enables IIS administrators to create powerful customized rules to map request URLs to friendly URLs that are easier for users to remember and easier for search engines to find. You can use the URL Rewrite module to perform URL manipulation tasks, some of which include:

  • Define powerful rules to transform complex URLs into simple and consistent Web addresses.
  • Easily replace Web application URLs to produce user and search engine friendly results.
  • Rewrite URLs based on HTTP headers and IIS server variables.
  • Perform redirects, send custom responses, or stop HTTP requests based on the logic expressed in the rewrite rules.
  • Control access to Web site content based on URL segments or request metadata.

URL Rewrite 2.0 features

The Microsoft URL Rewrite module 2.0 includes the following key features:

  • Rules-based URL rewriting engine. Rewrite rules define the logic used to analyze request URLs and map them to rewite URLs when the request URL matches a defined rule. Web server and site administrators can use rewrite rule sets to define URL rewriting logic.

  • Regular expression pattern matching. Rewrite rules can use regular expression syntax for pattern matching as defined in ECMA-262.

  • Wildcard pattern matching. Rewrite rules can use wildcard syntax for pattern matching.

  • Global and distributed rewrite rules. URL Rewrite uses global rules to define server-wide URL rewriting logic. These rules are defined within the applicationHost.config file, and they supercede rules configured at lower levels in the configuration hierarchy. The module also uses distributed rules to define URL rewrite logic specific to a particular configuration scope. This type of rule can be defined on any configuration level by using Web.config files.

  • Access to server variables and HTTP headers. Server variables and HTTP headers provide additional information about current HTTP requests. This information can be used to configure rewrite rules or to compose the output URL.

  • Various rule actions. Instead of rewriting a URL, a rule may perform other actions, such as issue an HTTP redirect, abort the request, or send a custom status code to HTTP clients.

  • Support for IIS kernel mode and user mode output caching. IIS 7 output caching provides significant performance improvements for Web applications. The URL Rewrite module is fully compatible with both types of output caching. This means that it is possible to safely cache responses for rewritten URL's and thus boost the performance of Web applications that rely on URL rewriting.

  • String manipulation functions. Built-in string manipulation functions can be used to convert URLs to lowercase and to perform URL encoding and decoding.

  • Rewrite maps. A rewrite map is an arbitrary collection of name-value pairs. You can use a rewrite map within rewrite rules to generate the substitution URL. Rewrite maps are particularly useful when you have a large set of rewrite rules, all of which use static strings (i.e. there is no pattern matching used). In those cases, instead of defining a large set of simple rewrite rules, you can put all the mappings between into the rewrite map using the input URL as a key, and the substitution URL as value. You can then have one rewrite rule that references the rewrite map to look up substitution URL based on the input URL.

  • Failed Request Tracing support. IIS 7 Failed Request Tracing can be used to troubleshoot errors related to URL rewriting.

  • Rule templates. A rule template is an extension for the URL Rewrite module user interface that simplifies creation of rewrite rules for a particular task. The module includes 3 rule templates, and also supports plugging in any number of custom templates.

  • User Interface (UI) for testing regular expression and wildcard patterns. A UI for testing rule patterns is provided with the module. Using the UI, you can quickly check the results of a regular expression or wildcard pattern in a rewrite rule. You can also use the UI for troubleshooting and debugging problems related to pattern matching.

  • UI for managing rewrite rules and rewrite maps. Rewrite rules and rewrite maps can be added, removed, and edited by using the URL Rewrite Module from the IIS Manager.

  • UI for importing mod_rewrite rules. The URL Rewrite module includes a UI for converting rewrite rules from mod_rewrite format into an IIS format.

Where to get the URL Rewrite module

For more information and to download the module, see URL Rewrite.

Download the x86 version of the URL Rewrite module

Download the x64 version of the URL Rewrite module

Upgrading from Go Live release

If you already have the Go Live release of URL rewrite module installed the installation package will upgrade it to URL Rewrite version 2.0. All rewrite rules in your ApplicationHost.config and Web.config files will be preserved.

ASP.NET update

The URL Rewrite module installer package includes an ASP.NET update that fixes ASP.NET bugs specific to the URL Rewrite module. SPecifically, the update contains fixes for the following bugs:

  1. ~ operator in ASP.NET Web server control is resolved incorrectly when using URL Rewrite.
  2. ASP.NET SiteMap.CurrentNode property returns null when sitemap contains virtual URLs.

The update is applied only if the machine where URL Rewrite module is being installed has .NET Framework version 3.5 SP1 or higher. If you install the required version of the .NET Framework after you install the URL Rewrite module, you can apply the ASP.NET update by running the URL Rewrite module installer and then selecting the Repair option in the installer dialog.

For more details about these and other ASP.NET issues related to URL rewriting, see URL Rewriting for ASP.NET Web Forms.

Using the module

These articles cover the functionality of the URL Rewrite Module and explain how to use it to implement common URL rewriting scenarios.

Learning the basics

References and guidance

Video walkthrough

Changes since Go Live release

The following additions, changes, and important bug fixes have been made to URL rewrite module since the Go Live release:

  1. Added string manipulation functions UrlEncode and UrlDecode.
  2. Provided access to a raw original URL via server variable UNENCODED_URL. This server variable now contains the raw encoded URL exactly as it was requested by Web browser.
  3. Added UI for configuring rewrite rules for Application Request Routing (ARR).
  4. Added support for in-place upgrade from the Go Live release of the URL rewrite module.
  5. Added functionality to clean up the internal cache to avoid excessive usage of memory when caching rewrite rules.
  6. Fixed a bug related to rewriting of URLs that contain non-ASCII characters.
  7. Fixed a bug in processing regular expressions that caused character ranges to be evaluated incorrectly for case-insensitive patterns.
  8. Included an update for IIS FastCGI module into the installer package.
  9. Included an update for System.Web.dll into the installer package.
  10. Included an update for the IIS SetUri function into the installer package.

Known Issues

  1. mod_rewrite rules that use REQUEST_URI server variables may not work correctly when imported by using URL Rewrite the Import Rules feature. To fix the imported rules use, you can use any text editor to open the Web.config file that contains those rules. Locate the <rewrite> section, and then within that section replace all instances of the string “{SCRIPT_NAME}” with the string “{URL}”.
  2. Digest authentication cannot be used with URL Rewrite module.
  3. ASP.NET Forms authentication uses rewritten URL for redirection. For example, if the requested URL is "/article.htm" and the URL Rewrite module rewrites the URL to "/article.aspx", which is protected by Forms authentication, then ASP.NET will redirect to "/login.aspx?ReturnUrl=%2Farticle.aspx".
  4. Auto-detect mode in ASP.NET Forms authentication uses a rewritten URL for redirection. For example, if the requested URL is "/article.htm" and the URL Rewrite module rewrites the URL to "/article.aspx", which is protected by Forms authentication, then ASP.NET will redirect to "/article.aspx?AspxAutoDetectCookieSupport=1".
  5. UseUri mode in ASP.NET Forms authentication uses rewritten URL for redirection. For example, if the requested URL is "/article.htm" and URL Rewrite module rewrites the URL to "/article.aspx", which is protected by Forms authentication, then ASP.NET will redirect to "/(S(vy2ebt45imfkmjjwboow3l55 ))/article.aspx".
  6. ASP.NET rewrites back to the original URL when using URI-based authentication or cookie-less session state. For example, when a request is made to "/(S(vy2ebt45imfkmjjwboow3l55 ))/article.htm" and URL rewrite module rewrites "/article.htm" to "/article.aspx", then ASP.NET will rewrite the URL back to "/article.htm", which may result in a "404 - File Not Found" error.
  7. The IIS DefaultDocument module may redirect to a rewritten URL when the URL Rewrite module rewrites to a folder. For example, if the substitution URL in a rewrite rule is "/folder1/folder2" and these folders exist on the file system and have a Default document configured, then the DefaultDocument module will redirect Web clients to "/folder1/folder2/", thus exposing the rewritten URL. To prevent this from happening, use "/" at the end of the substitution URL when rewriting to a folder, for example, "/folder1/folder2/"

 

from: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

转载于:https://www.cnblogs.com/Langzi127/archive/2011/06/29/2093471.html

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/dengxie4419/article/details/101489572

智能推荐

【转】2023年Java学习路线图-黑马程序员-程序员宅基地

文章浏览阅读7.5k次,点赞28次,收藏411次。Java面试宝典(含阿里、腾迅大厂java面试真题,java数据结构,java并发,jvm等java面试真题)以100+企业大厂真实高频Java面试真题为主干,辅以数据结构的可视化展示、算法的可视化展示,窥探底层的工具使用等等可视化手段,用直观、形象的方式展现复杂的知识内容,让学生更清晰、更容易地掌握这些Java面试题与Java知识点。简单的说,就是一次大的操作由不同的小操作组成,这些小的操作分布在不同的服务器上,且属于不同的应用,分布式事务需要保证这些小操作要么全部成功,要么全部失败。

UE4的AI行为树基础知识_ue4行为树-程序员宅基地

文章浏览阅读1.4k次。UE4的AI基础学习_ue4行为树

【华为云技术分享】一文带你了解Web前端发展历程_华为云前端发版-程序员宅基地

文章浏览阅读2.5k次。摘要:自互联网行业发展以来,web前端不断发展变化着。在前人的基础上,后人有幸能够站在前人的肩膀上行走。前端的发展变化不仅是继承式的迭代,同时也是不断的变革和创造。一、前端到底是个什么?简单点说,浏览器呈现出来的页面,给用户看的、操作的就是前端(客户端);你看不到的,类似一些游戏数据、应用数据之类的就是后端(服务端)。那么再简单点就可以说,前端指的就是浏览器端,后端指的就是为浏览器提供服务和数据的服务器端。这是比较准确的描述,如果往大了讲,你所有看到的一切,网页、移动端网页、小程序、甚._华为云前端发版

MutationObserver - 监听Dom变化_mutationobserver.observe-程序员宅基地

文章浏览阅读783次,点赞18次,收藏26次。监听DOM变化(属性变动、目标子节点变化、观察后代节点等)_mutationobserver.observe

【C/C++】freopen 函数和 fopen 函数|标准输入输入写入文件|屏幕输出写入文件-程序员宅基地

文章浏览阅读9.8k次,点赞13次,收藏65次。freopen 和 fopen 都是C的标准库函数被包含于C标准库头文件中。fopen就是我们最熟悉的打开一个文件用于写入or读取freopen 是打开一个文件,用于接收输入输出流的数据。_freopen

python sys.path.append()和sys.path.insert()_sys. addpath-程序员宅基地

文章浏览阅读3.8k次。转载自: https://blog.csdn.net/dcrmg/article/details/79546962python程序中使用 import XXX 时,python解析器会在当前目录、已安装和第三方模块中搜索 xxx,如果都搜索不到就会报错。 使用sys.path.append()方法可以临时添加搜索路径,方便更简洁的import其他包和模块。这种方法导入的路径会在python程..._sys. addpath

随便推点

BiLSTM双向长短期记忆神经网络回归预测算法(基于Matlab实现)_双向bilstm模型-程序员宅基地

文章浏览阅读539次,点赞11次,收藏9次。正向的LSTM网络接受序列数据的初始状态,逐步学习前向信息并更新内部隐藏状态,最终生成前向隐藏状态序列。反向的LSTM网络则以相反的顺序处理序列数据,并生成相应的反向隐藏状态序列。本文将介绍使用Matlab实现的BiLSTM算法,并展示其在多输入单输出回归问题上的应用。然后,我们定义了BiLSTM模型的层次结构,包括序列输入层、BiLSTM层、全连接层和回归层。与传统的单向LSTM相比,BiLSTM能够同时利用序列数据的前向和后向信息,从而提高模型在长期依赖关系上的学习能力。_双向bilstm模型

D78XX系列——用于各种电视机、收录机、电子仪器、设备的稳压电源电路,输出电流大,内设过热、短路保护电路,无需外接元件-程序员宅基地

文章浏览阅读295次,点赞9次,收藏11次。D78XX系列是用于各种电视机、收录机、电子仪器、设备的稳压电源电路。包括D7805、D7806、 D7808、 D7809、 D7810、 D7812、 D7815。● 输出电流大,IOMAX= 1A.● 封装形式: T0-220。● 内设过热、短路保护电路。

stm32入门学习(基于STM32F103C8T6)_stm32f103c8t6csdn-程序员宅基地

文章浏览阅读456次,点赞8次,收藏2次。じゃ、始めましょう。--最近在学外语,对于IT从业者来说,会是一项优势。_stm32f103c8t6csdn

Anaconda安装_anaconda环境变量e:\anaconda3\library\usr\bin-程序员宅基地

文章浏览阅读7.1k次,点赞41次,收藏196次。文章目录1.Anaconda是什么2.Anaconda下载3.Anaconda安装4.Anaconda环境变量配置5.检验是否安装成功6.检验Anaconda Navifator是否安装成功7.修改Anaconda镜像修改为清华大学镜像移除清华大学镜像8.PyCharm配置Anaconda方式一(建立新的项目时)方式二(已经打开项目)9.总结1.Anaconda是什么Anaconda指的是一个开源的Python发行版本,其包含了conda、Python等180多个科学包及其依赖项。Anaconda也是P_anaconda环境变量e:\anaconda3\library\usr\bin

70个常用电脑快捷键,帮你工作效率提升100倍!职场新人必备!_快捷键可以帮助自己-程序员宅基地

文章浏览阅读2k次,点赞11次,收藏44次。电脑快捷键不仅可以帮助我们熟练的操作电脑,还可以帮助我们快速提升自己的工作效率,从此跟加班说拜拜!但由于电脑快捷键过于繁多不方便我们记忆!那么今天小编为大家整理的70个Wordows、Ctrl、Alt、Shift组合快捷键,运用好的话能够帮你工作效率提升100倍!希望能为大家派上用途!下面以图片&amp;文字的形式展现给大家!文字可以直接复制!图片也可以直接拿去收藏!..._快捷键可以帮助自己

用HTML语言制作一个非常浪漫的生日祝福网,手把手教你制作炫酷生日祝福网页_用html做一个生日快乐网页-程序员宅基地

文章浏览阅读2.2w次,点赞317次,收藏636次。明天就是女朋友的生日了, 是时候展现专属于程序员的浪漫了!你打算怎么给心爱的人表达爱意?鲜花礼物?代码表白?还是创意DIY?或者…无论那种形式,快来秀我们一脸吧!_用html做一个生日快乐网页

推荐文章

热门文章

相关标签