SoFunction
Updated on 2025-04-13

ISAPI_rewrite Chinese Reference Manual Page 2/3


I (ignore case) 
This FLAG affects the RewriteRule directive and the corresponding RewriteCond directive regardless of upper and lower case.
F (Forbidden) 
React to the client, stop the REWRITING process and send a 403 error. Note that in this case FORMATSTRING is useless and can be set to any non-empty string.
L (last rule) 
No rewrite rules are applied to stop the rewrite process here. Use this FLAG to prevent the currently rewrited URI from being rewrited by the subsequent rules.
N (Next iteration) 
Force REWRITINGENGINE to adjust the rule target and restart the rule check from the beginning (all modifications will be saved). The number of restarts is limited by the value specified by RepeatLimit. If this value exceeds N, FLAG will be ignored.
NS (Next iteration of the same rule) 
The N flag does not restart the rule rule process from the same rule (for example, forcing the application of repeated rules) and specify the maximum number of repeated rules through the RepeatLimit instruction.
P (force proxy)  
The mandatory purpose URI is forced internally to proxy requirements and immediately meets proxy requirements through ISAPI extension. It is necessary to confirm that the proxy string is a valid URI including protocol host, etc. Otherwise the proxy will return an error.
R (explicit redirect) 
Force the server to issue an instant response to the client's redirection instructions, providing a new address of the destination URI. The redirection rule is often the last rule.
RP (permanent redirect) 
Almost the same as [R] tag but publish 301HTTP status instead of 302HTTP status code
U (Unmangle Log) 
Record URI when the URI is a source requirement rather than a rewrite requirement
O (nOrmalize) 
Standardize strings before implementation. Standardization includes URL-ENCODING, re-moval of illegal characters, etc. This tag is useful for URLS and URLS-ENDODED headers.
CL (Case Lower)  
Lowercase
CU (Case Upper)  
Capitalization
RewriteHeader directive 
Syntax: RewriteHeader HeaderName Pattern FormatString [Flags]  
This directive is a more generalized variant of RewriteRule. It not only rewrites the client requirements part of the URL, but also rewrites the HTTP header. This directive is not only used for rewriting. Generate, delete any HTTP header, or even change the method of client requests
HeaderName  
Specify the client header to be rewritten, the desirable value is the same as the TestVerb parameter in the RewriteCond directive.

Pattern 
Qualify rule expressions to match Request-URI,
FormatString  
Qualify FormatString that will generate a new URI
[Flags] 
It is a command-separated list of the following FLAGS
I (ignore case) 
This FLAG affects the RewriteRule directive and the corresponding RewriteCond directive regardless of upper and lower case.
F (Forbidden) 
React to the client, stop the REWRITING process and send a 403 error. Note that in this case FORMATSTRING is useless and can be set to any non-empty string.
L (last rule) 
No rewrite rules are applied to stop the rewrite process here. Use this FLAG to prevent the currently rewrited URI from being rewrited by the subsequent rules.
N (Next iteration) 
Force REWRITINGENGINE to adjust the rule target and restart the rule check from the beginning (all modifications will be saved). The number of restarts is limited by the value specified by RepeatLimit. If this value exceeds N, FLAG will be ignored.

NS (Next iteration of the same rule) 
The N flag does not restart the rule rule process from the same rule (for example, forcing the application of repeated rules) and specify the maximum number of repeated rules through the RepeatLimit instruction.

R (explicit redirect) 
Force the server to issue an instant response to the client's redirection instructions, providing a new address of the destination URI. The redirection rule is often the last rule.
RP (permanent redirect) 
Almost the same as [R] tag but publish 301HTTP status instead of 302HTTP status code
U (Unmangle Log) 
Record URI when the URI is a source requirement rather than a rewrite requirement
O (nOrmalize) 
Standardize strings before implementation. Standardization includes URL-ENCODING, re-moval of illegal characters, etc. This tag is useful for URLS and URLS-ENDODED headers.
CL (Case Lower)  
Lowercase
CU (Case Upper)  
Capitalization

To re-moving the header, the FORMAT STRING pattern should generate an empty string, for example, this rule will re-moving proxy information from the client request.
RewriteHeader User-Agent: .* $0 
And this rule will add OLD-URL HEADER to the request.
RewriteCond URL (.*)RewriteHeader Old-URL: ^$ $1 
The last example will direct all WEBDAV requests to /WEBDAV by changing the request method. ASP
RewriteCond METHOD OPTIONS 
RewriteRule (.*) /?$1 
RewriteHeader METHOD OPTIONS GET 
RewriteProxy directive 
Syntax: RewriteProxy Pattern FormatString [Flags]  
Force the purpose URI internally enforces the proxy requirements and immediately meets the proxy requirements through ISAPI extensions, which will allow IIS to act as a proxy server and rerout to other sites and servers
Pattern 
Qualify rule expressions to match Request-URI,
FormatString  
Qualify FormatString that will generate a new URI
[Flags] 
It is a command-separated list of the following FLAGS
D (Delegate security)  
Agent mode will attempt to log in to the remote server as the current fake user qualification,
C (use Credentials)  
Agent mode will attempt to log into the remote server with the qualification specified in the URL or the basic authorization header file. With this tag you can use http://user:password@/path/ syntax as the URL
F (Follow redirects) 
By default, ISAPI_Rewrite will attempt to transfer the redirect instruction returned by the MAP remote server to the local server namespace. If the remote server returns to the redirect point to a certain location other than that server, ISAPI_Rewrite will modify this redirect instruction to point to the server name, which will prevent the user from seeing the real (internal) server name.
Use the F tag to force proxy mode to internally track the redirection instructions returned by the remote server. Use this tag If you do not need to accept the redirection instructions of the remote server at all, there is a redirection restriction in the WINHTTP settings to avoid remote redirection loops.
I (ignore case)  
Forced character matching regardless of upper and lower case
U (Unmangle Log) 
Record URI when the URI is a source requirement rather than a rewrite requirement
O (nOrmalize) 
Standardize strings before implementation. Standardization includes URL-ENCODING, re-moval of illegal characters, etc. This tag is useful for URLS and URLS-ENDODED headers.
CacheClockRate directive 
Syntax: CacheClockRate Interval  
This instruction only appears in the GLOBAL configuration content. If this instruction appears in the SITE-LEVEL content, it will be ignored and the error message will be written to the file.
ISAPI_Rewrite caches is configured every time it is loaded for the first time. Using this directive you can limit the inactive cycle when a specific site is cleaned from the cache. Set this parameter to be large enough. You can force ISAPI_Rewrite to never clean the cache. Remember that any configuration file changes will be updated immediately after the next request and ignore this cycle.
Interval  
Limited the inaction time (in seconds) of cache cleaned out of a specific configuration, the default value is 3600 (1 hour)
EnableConfig and DisableConfig directives 
Syntax: 
EnableConfig [SiteID|"Site name"] 
DisableConfig [SiteID|"Site name"]  
Activate or do not activate the SITE-LEVEL configuration for the selected site or change the default configuration. The default SITE-LEVEL configuration is not activated. This instruction only appears in the GLOBAL configuration content.
SiteID  
Numeric metabase identifier of a site 

Site name  
Name of the site as it appears in the IIS console 
Using this command without parameters will change the default configuration to the ENABLE/DISABLE configuration process.
example
The following example will make the configuration only work on sites whose name is MY SITE
DisableConfig 
EnableConfig 1 
EnableConfig"My site" 
The following example will activate the SOMESITE configuration name as SOMESITE because it splits the settings and overloads the default settings.
EnableConfig"Some site" 
DisableConfig 
EnableRewrite and DisableRewrite directives  
Syntax: 
EnableRewrite [SiteID|"Site name"] 
DisableRewrite [SiteID|"Site name"]  
Activate or do not activate the selected site and rewrite or change the default configuration. The default rewrite configuration is activated. This command only appears in the GLOBAL configuration content.
SiteID  
Numeric metabase identifier of a site 

Site name  
Name of the site as it appears in the IIS console. 

This command will be activated or not activated without using parameters.
RepeatLimit directive 
Syntax: RepeatLimit Limit  
This instruction can appear in the GLOBAL and SITE-LEVEL configuration files. If it appears in the GLOBAL configuration file, it changes the restrictions on all sites. If it appears in the SITE-LEVEL configuration, it only changes the restrictions on this site and this limit cannot exceed the GLOBAL limit.
ISAPI_Rewrite allows loops when implementing rules. This directive allows limiting the maximum number of possible loops. It can be set to 0 or 1 without supporting loops.
LIMIT 
Limit the maximum number of cycles, default 32
RFStyle directive 
Syntax: RFStyle Old | New  
Configuration Utility 
ISAPI_Rewrite Full includes configuration function (can be started in the ISAPI_Rewrite program group), which allows you to browse the test status and enter the registration code (if it is not registered during the installation process), and adjust some product functions related to proxy mode operations. UTILITY is an attribute table composed of three pages.
Trial page allows you to browse the TIRAL status and enter the registration code (if there is no registration during the installation process)
Settings page 
This page contains an edit box for the following parameters

Helper URL  
This parameter affects the connection between the filter and the proxy module, that is, it can be a file extension prefixed with dots (such as .isrwhlp) or an absolute path.
In the first case, the extension will be appended to the initial request URI and the proxy module is activated through SCRIPT MAP. The default extension isrwhlp is added to the global script map in the installation process. If you change this extension or your application does not inherit global script map, you should manually add the entry required to script map. This should have the following parameters
Executable: An absolute path to the  in the short form  
Extension: Desired extension (.isrwhlp is default)  
Verbs radio button: All Verbs  
Script engine checkbox: Checked  
Check that file exists checkbox: Unchecked  
We have created a WSH script which can be simply registered in a script maps. It is located in the installation folder and can be run on the command line as follows.
cscript  [-r] [MetabasePath]  
Optional -r Forced registration of extension
Optional MetabasePath parameter allows specification of the first metabase key to process. By default it is "/localhost/W3SVC". 
To register in all existing script maps you can activate script
cscript  -r  
In the second case, you should provide a URI as the value of 'Helper URL', and you should also map an ISAPI_Rewrite installation folder as the virtual file home for Meiyi sites.
Note: According to customer response, IIS5 (maybe including IIS4) has problems with long directory names. So we highly recommend using short directory names
Worker threads limit  
This parameter limits the number of worker threads in the proxy extension thread pool, the default is 0, which means that this limit is equal to the number of processors multiplied by 2
Active threads limit 
This parameter limits the current number of running threads, and this number cannot be greater than "Worker threads limit". The default 0 means equal to the number of processors
Queue size This parameter defines the maximum number of requests. If you have ever seen Queue timeout expired” in the Application event log you can add this parameter
Queue timeout  
This parameter defines the maximum waiting time for you to prevent new requests in the internal request queue. If you have ever seen the Queue timeout expired” information in the Application event log you can add this parameter
Connect timeout  
Set the proxy module connection timeout in milliseconds
Send timeout  
Set the proxy module sending timeout in milliseconds
Receive timeout  
Set the proxy module sending timeout in milliseconds
About page.  
It contains copyright information and a link to the ISAPI_Rewrite's web site.  
 
Previous page123Next pageRead the full text