IIS Rewrite Input Types

久未见 提交于 2019-12-23 07:07:35

问题


What are the input types you can use in IIS rewrite rules? The ones I mean are like as follows:

<conditions>
    <add input="{HTTP_HOST}" type=”Pattern” pattern="^www\.mysite\.com$" negate="true"> 
</conditions>
  • HTTP_HOST
  • URL
  • REQUEST_FILENAME
  • ?

回答1:


You can try the below input types. See also reference docs for the URL Rewrite module.

  • CACHE_URL
  • DOCUMENT_ROOT
  • HTTP_URL
  • HTTP_HOST
  • PATH_INFO
  • PATH_TRANSLATED
  • QUERY_STRING
  • REQUEST_FILENAME
  • REQUEST_URI
  • SCRIPT_FILENAME
  • SCRIPT_NAME
  • SCRIPT_TRANSLATED
  • UNENCODED_URL
  • URL
  • URL_PATH_INFO
  • APP_POOL_ID
  • APPL_MD_PATH
  • APPL_PHYSICAL_PATH
  • GATEWAY_INTERFACE
  • SERVER_SOFTWARE
  • SSI_EXEC_DISABLED
  • SERVER_NAME



回答2:


You can also use IIS (7 and above I believe):

Open IIS => Navigate to your website => Double-click URL Rewrite => Edit a rule => Add or Edit a condition => When you start typing '{' in the 'Condition input' field, a list of types will appear.



来源:https://stackoverflow.com/questions/9987048/iis-rewrite-input-types

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!