ISAPI Rewrite Unofficial Chinese Configuration Manual _ Blue version 1th/3 Page _ Server

Source: Internet
Author: User
Tags configuration settings connection pooling manual lowercase server port
This help file is sent because when you set up a host to your friends, they found that their ISAPI rewrite settings are somewhat incorrect, and some even hinder the normal operation of the site. The official English help is roughly translated. We are free to use and reprint. However, if you wish to reprint, please specify the version of the Blue translation.

===================
Introduction to ISAPI Rewrite configuration:

On the NT/2000/XP and 2003 platforms, the ISAPI rewrite is launched into the Inetinfo process and IIS in a coexistence mode filter under the SYSTEM account. Therefore, the system account should give the Isapi-rewirite DLLS Internet Anonymous Access group readable executable permission and all HTTPD. INI file can be read right and should also be given to the system account for all including HTTPD. INI file's folder, which will allow HTTP to be generated. PARSE. ERRORS log file to record a configuration file syntax error. Additional permissions are required for the proxy module because it will run in connection pooling or high-isplated application mode, and the IIS account sharing pool and high-isolation pool should be given to Rwhelpere. The Read permission for the DLL. By default iwam-"computer name" is used in all pools, and a pool account should be established in the corresponding COM + application settings with the help of Com+administration MMC snap-in

Configuration file Format:

There are two types of configuration files: Global (server global mode) and individual (site independent setup mode) files, and the global (server-side global mode) profile should be placed in the Isapi-rewrite installation directory, named Httpd.ini. This file can be accessed and configured through a shortcut to the Start menu, which is a global rule that will work for all sites. Individual (site independent setup mode) configuration file should be placed in the root directory of the virtual site, also named Httpd.ini file, which should be placed for the site mapping configuration settings, only for the placed virtual site valid. Both types of Httpd.ini are standard Windows INI files. All mapping rules should be placed after [Isapi_rewrite]. The previous file text will be ignored.


HTTPD. INI file example

[Isapi_rewrite]

# This is a comment

# 5 minutes

Cacheclockrate 300

Repeatlimit 20

# Set permissions for others who do not download Httpd.ini and httpd.parse.errors files

REWRITERULE/HTTPD (?: \. ini|\.parse\.errors)/[F,i,o]

# Block external access to the Helper ISAPI Extension

Rewriterule. *\.isrwhlp/[F,i,o]

# Configuration Rules

Rewritecond Host: (. +)

Rewritecond directives

Syntax: (syntactic) Rewritecond testverb Condpattern [Flags]

This instruction defines a conditional rule that pretesting the rewritecond instruction before the rewriterule or Rewriteheader or rewriteproxy instruction, followed by its only pattern matching the current state of the URI and the additional conditions applied.

Testverb

Specifies verb that would be matched against regular expression.

Specifically defined verbs match the specified expression

testverb= (URL | Method | VERSION | Httpheadername: | %servervariable) Where:

Url-returns Request-uri of client Request as described in RFC 2068 (HTTP 1.1);

Returns the Request-uri of the requirements described by the client in RFC2068

Method-returns HTTP method of the client request (OPTIONS, GET, head, POST, put, DELETE or TRACE);

Returns HTTP methods for client requirements (OPTIONS, get, head, POST, put, DELETE or TRACE)

Version-returns HTTP version;

Return HTTP version

Httpheadername-returns value of the specified HTTP header. Httpheadername can is any valid HTTP header name. Header names should include the trailing colon ":". If specified header does not exists in a client's request Testverb is treated as empty string.

Returns the value of a defined HTTP header file

Httpheadername =

Accept:

Accept-charset:

Accept-encoding:

Accept-language:

Authorization:

Cookies:

From:

Host:

If-modified-since:

If-match:

If-none-match:

If-range:

If-unmodified-since:

Max-forwards:

Proxy-authorization:

Range:

Referer:

User-agent:

Any-custom-header

Get more information about HTTP header files and their values reference RFC2068

ServerVariable returns the value of a defined server variable. For example, the server port, the list of all server variables should be established in the IIS document, variable name to apply the% character reservation;

Condpattern

The regular expression to match Testverb

Regular expression Matching Testverb

[Flags]

The flags is a comma-separated list of the following flags:

O (normalize)

normalizes string before processing. Normalization includes removing of a url-encoding, illegal characters, etc. This flag are useful with URLs and url-encoded headers

Rewriterule directives

Syntax:rewriterule pattern formatstring [Flags]

This instruction can occur more than once, and each instruction defines a separate rewrite rule, which is important because the command is useful for applying runtime rules

I (Ignore case)

This flag affects rewriterule instructions and corresponding rewritecond directives, regardless of the case of a forced character match.

F (Forbidden)

React to the client, stop the rewriting process, and send a 403 error, noting that in this case the formatstring is useless and can be set to any non-empty string.

L (last Rule)

Do not apply any overriding rules this stops the rewrite process, using this flag to prevent the currently overridden URI from being rewritten again by the following rule

N (Next iteration)

Force Rewritingengine to adjust the rule target and reboot the rule check (all modifications will be saved), the number of restarts is limited by the value specified by Repeatlimit, if this number exceeds n flag will be ignored

NS (Next iteration of the same rule)

Working with n tags does not restart the rule rule process from the same rule (such as enforcing a duplicate rule application), specifying a maximum number of recurring rules through the repeatlimit instruction.

P (Force proxy)

Forcing the destination URI internally to enforce proxy requirements and to immediately address proxy requirements through an ISAPI extension, you must verify that the proxy string is a valid URI including the protocol host, or the proxy will return an error

R (Explicit redirect)

Forces the server to send a redirect to the client to indicate an immediate response, providing a new address for the destination URI, which is often the final rule

RP (Permanent redirect)

Almost identical to [R] tags but publishes a 301HTTP state instead of a 302HTTP status code

U (Unmangle Log)

Chronicle URI when URI is source requirement rather than overriding requirement

O (normalize)

Standardize the string before it is implemented. Standardization includes url-encoding, the movement of illegal characters, etc., which is useful for URLs and urls-endoded headers.

CL (case Lower)

Lowercase

CU (case Upper)

Capital

Rewriteheader directive

Syntax:rewriteheader headername pattern formatstring [Flags]

This directive is a more generalized variant of the Rewriterule, which not only overrides the client requirements section of the URL, but also overrides the HTTP header, which is not only used for rewriting. Generate, remove any HTTP headers, and even change the client request method

Headername

Specifies the client header to be overridden, with the desired value the same as the Testverb parameter in the Rewritecond directive

Pattern

Qualifying rule expressions to match Request-uri,

FormatString

Limit the formatstring that will generate the new URI

[Flags]

is a command-delimited list of the following flags

I (Ignore case)

This flag affects rewriterule instructions and corresponding rewritecond directives, regardless of the case of a forced character match.

F (Forbidden)

React to the client, stop the rewriting process, and send a 403 error, noting that in this case the formatstring is useless and can be set to any non-empty string.

L (last Rule)

Do not apply any overriding rules this stops the rewrite process, using this flag to prevent the currently overridden URI from being rewritten again by the following rule

N (Next iteration)

Force Rewritingengine to adjust the rule target and reboot the rule check (all modifications will be saved), the number of restarts is limited by the value specified by Repeatlimit, if this number exceeds n flag will be ignored

NS (Next iteration of the same rule)

Working with n tags does not restart the rule rule process from the same rule (such as enforcing a duplicate rule application), specifying a maximum number of recurring rules through the repeatlimit instruction.

R (Explicit redirect)

Forces the server to send a redirect to the client to indicate an immediate response, providing a new address for the destination URI, which is often the final rule

RP (Permanent redirect)

Almost identical to [R] tags but publishes a 301HTTP state instead of a 302HTTP status code

U (Unmangle Log)

Chronicle URI when URI is source requirement rather than overriding requirement

O (normalize)

Standardize the string before it is implemented. Standardization includes url-encoding, the movement of illegal characters, etc., which is useful for URLs and urls-endoded headers.

CL (case Lower)

Lowercase

CU (case Upper)

Capital

To move the header, FORMAT string mode should generate an empty string, for example, this rule will redirect agent information from the client request

Rewriteheader user-agent:. * $

And this rule will add the Old-url HEADER to the request.

Rewritecond URL (. *) Rewriteheader Old-url: ^$ $

The last example will redirect all WEBDAV requests to/webdav by changing the request method. Asp

Rewritecond Method OPTIONS

Rewriterule (. *)/webdav.asp?$1

Rewriteheader method OPTIONS Get

REWRITEPROXY directive

Syntax:rewriteproxy pattern formatstring [Flags]

Forcing the destination URI internally to enforce the proxy requirements and to immediately address the agent requirements through the ISAPI extension, which will allow IIS to act as a proxy server and reroute to other sites and servers

Pattern

Qualifying rule expressions to match Request-uri,

FormatString

Limit the formatstring that will generate the new URI

[Flags]

is a command-delimited list of the following flags

D (Delegate Security)

Agent mode will attempt to log on to the remote server with the current fake user qualification.

C (use Credentials)

Proxy mode will attempt to log in to the remote server as specified in the URL or basic authorization header file, with this tag you can use Http://user:password@host.com/path/syntax as the URL

F (Follow redirects)

By default, Isapi_rewrite will attempt to redirect the redirected instruction returned by the map remote server to the local server namespace, and if the remote server returns a redirection point to another location on that server, Isapi_rewrite will modify the redirection instruction to point to this server name. This will prevent users from seeing real (internal) server names

Use the F tag to force agent mode to keep track of redirect instructions returned by a remote server, using this tag if you do not need to accept a remote server redirection directive, there is a redirection limit in the WinHTTP setting to avoid a remote redirect loop
current 1/3 page   1 23 Next read the full text

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.