Óû§Ãû UID Email
  • «
  • 1
  • 2
  • »
  • Pages: 1/2     Go
PW¹Å¶­¼¶±¦±´
¼¶±ð: ×ܰæÖ÷
ÌØÊâ¹±Ï×½± ²å¼þ´óʦ½± ÈÈÐÄÖúÈ˽±
Â¥Ö÷  ·¢±íÓÚ: 2006-02-26 11:49

 [ת]ISAPI_rewriteÖÐÎÄÊÖ²á

Ô­Îĵµ£ºhttp://www.isapirewrite.com/docs/

=========================================
ÅäÖãº
ÔÚNT 2000 XPºÍ2003ƽ̨ÉÏ£¬ÔÚϵͳÕÊ»§ÏÂÓ¦¸ÃINETINFO³ÌÐòÓ¦¸ÃÓëIIS5ÒÔ¹²´æÄ£Ê½¹ýÂËÆ÷ÔËÐС£ËùÒÔϵͳÕÊ»§Ó¦¸Ã¸øÓè¶ÔËùÓеÄISAPI-REWIRITE DLLS ºÍËùÓеÄHTTPD¡£INIÎļþÖÁÉٿɶÁȨÏÞ£¬ÎÒÃÇÒ²ÍÆ¼ö¶Ô¸øÓèϵͳÕÊ»§¶ÔÓÚËùÓаüÀ¨HTTPD¡£INIÎļþµÄÎļþ¼ÐµÄ¿ÉдȨÏÞ£¬Õ⽫ÔÊÐí²úÉúHTTP¡£PARSE¡£ERRORSÎļþ£¬ÕâЩÎļþ°üº¬ÅäÖÃÎļþÓï·¨´íÎó¡£¶ÔÓÚPROXYÄ£¿éÒ²ÐèÒª¶îÍâµÄȨÏÞ£¬ÒòΪËü½«ÔËÐÐÓÚÁ¬½Ó³Ø»òHIGH-ISPLATEDÓ¦ÓÃģʽ£¬IISÕÊ»§¹²Ïí³ØºÍHIGH-ISOLATION³ØÓ¦±»¸øÓè ¶ÔRWHELPERE¡£DLLµÄ¿É¶ÁȨÏÞ¡£È±Ê¡Çé¿öÏÂIWAM-¡¶¼ÆËã»úÃû¡·±»ÓÃÓÚËùÓеijأ¬ÔÚÏàÓ¦µÄCOM+Ó¦ÓÃÉèÖÃÖÐÓ¦½èÖúCOM+ADMINISTRATION MMC SNAP-IN½¨Á¢³ØÕÊ»§
ÅäÖÃÎļþ¸ñʽ»¯£º

ÓÐÁ½ÖÖÐÎʽµÄÅäÖÃÎļþ-GLOBAL£¨SERVER-LEVEL£©ºÍINDIVIDUAL£¨SITE-LEVAL£©Îļþ£¬GLOBALÅäÖÃÎļþÓ¦±»ÃüÃûΪHTTPD.INI²¢³öÏÖÔÚISAPI-REWRITE°²×°Ä¿Â¼ÖУ¬ÎļþµÄ¿ì½Ý·½Ê½Í¨¹ý¿ªÊ¼²Ëµ¥Ìṩ£¬INDIVIDUALÅäÖÃÎļþÓ¦ÃûΪHTTPD¡£INI²¢ÇÒÄܹ»³öÏÖÔÚÐéÄâÕ¾µãµÄÎïÀí¸ùĿ¼ÖУ¬Á½ÖÖÀàÐ͵ĸñʽ»¯ÊÇÏàͬµÄ²¢ÊDZê×¼µÄWINDOWS¡£INIÎļþ£¬ËùÓеÄÖ¸Áî¶¼Ó¦¸Ã·ÅÔÚÕâÒ»²¿·Ö²¢ÇÒËùÓÐÖ¸Áî¶¼Ó¦¸ÃÒÔ·Ö¸ôÏß·ÅÖã¬ÈκÎÕâÒ»²¿·ÖÒÔÍâµÄÎı¾¶¼½«±»ºöÂÔ

HTTPD.INIÎļþʾÀý

[ISAPI_Rewrite]

# This is a comment

# 300 = 5 minutes
CacheClockRate 300
RepeatLimit 20

# Block external access to the 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]

# Some custom rules
RewriteCond Host: (.+)

RewriteCond Ö¸Áî

Syntax:£¨¾ä·¨£© RewriteCond TestVerb CondPattern [Flags]
ÕâÒ»Ö¸ÁÒåÒ»¸öÌõ¼þ¹æÔò£¬ÔÚ RewriteRule »òÕß RewriteHeader»ò RewriteProxyÖ¸ÁîǰԤÐÐRewriteCondÖ¸ÁºóÃæµÄ¹æÔò Ö»ÓÐËüµÄ£¬Ä£Ê½Æ¥ÅäURIµÄµ±Ç°×´Ì¬²¢ÇÒ¶îÍâµÄÌõ¼þÒ²±»Ó¦ÓòŻᱻӦÓá£

TestVerb

Specifies verb that will be matched against regular expression.
ÌØ±ð¶¨ÒåµÄ¶¯´ÊÆ¥Å乿¶¨µÄ±í´ïʽ
TestVerb=(URL | METHOD | VERSION | HTTPHeaderName: | %ServerVariable) where:

URL - returns Request-URI of client request as described in RFC 2068 (HTTP 1.1);
·µ»Ø¿Í»§¶ËÔÚRFC2068ÖÐÃèÊöµÄÐèÇóµÄRequest-URI
METHOD - returns HTTP method of client request (OPTIONS, GET, HEAD, POST, PUT, DELETE or TRACE);
·µ»Ø¿Í»§¶ËÐèÇó(OPTIONS, GET, HEAD, POST, PUT, DELETE or TRACE)µÄHTTP·½·¨
VERSION - returns HTTP version;
·µ»ØHTTP°æ±¾
HTTPHeaderName - returns value of the specified HTTP header. HTTPHeaderName can be 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.
·µ»ØÌض¨ÒåµÄHTTPÍ·ÎļþµÄÖµ
HTTPHeaderName =
Accept:
Accept-Charset:
Accept-Encoding:
Accept-Language:
Authorization:
Cookie:
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
µÃµ½¸ü¶àµÄ¹ØÓÚHTTPÍ·ÎļþµÄºÍËûÃǵÄÖµµÄÐÅÏ¢²Î¿¼RFC2068


ServerVariable ·µ»ØÌض¨ÒåµÄ·þÎñÆ÷±äÁ¿µÄÖµ ¡£ÀýÈç·þÎñÆ÷¶Ë¿Ú£¬È«²¿·þÎñÆ÷±äÁ¿ÁбíÓ¦ÔÚIISÎĵµÖн¨Á¢£¬±äÁ¿ÃûÓ¦ÓÃ%·ûÔ¤¶¨£»
CondPattern
The regular expression to match TestVerb
¹æÔò±í´ïʽƥÅäTestVerb
[Flags]
Flags is a comma-separated list of the following flags:


O (nOrmalize)
Normalizes string before processing. Normalization includes removing of an URL-encoding, illegal characters, etc. This flag is useful with URLs and URL-encoded headers
RewriteRule Ö¸Áî
Syntax: RewriteRule Pattern FormatString [Flags]
Õâ¸öÖ¸Áî¿ÉÒÔ²»Ö¹·¢ÉúÒ»´Î£¬Ã¿¸öÖ¸ÁÒåÒ»¸öµ¥¶ÀµÄÖØÐ´¹æÔò£¬ÕâЩ¹æÔòµÄ¶¨ÒåÃüÁîºÜÖØÒª£¬ÒòΪÕâ¸öÃüÁîÔÚÓ¦ÓÃÔËÐÐʱ¹æÔòÊÇÓÐÓÃ;µÄ

I (ignore case£©
²»¹Ü´óСдǿÐÐÖ¸¶¨×Ö·ûÆ¥Å䣬Õâ¸öFLAGÓ°ÏìRewriteRuleÖ¸ÁîºÍÏàÓ¦µÄRewriteCond Ö¸Áî
F (Forbidden)
¶Ô¿Í»§¶Ë×ö·´Ó¦£¬Í£Ö¹REWRITING½ø³Ì²¢ÇÒ·¢ËÍ403´íÎó£¬×¢ÒâÔÚÕâÖÖÇé¿öÏÂFORMATSTRING ÊÇÎÞÓõIJ¢¿ÉÒÔÉèÖÃΪÈκηǿÕ×Ö·û´®¡£
L (last rule)
²»Ó¦ÓÃÈκÎÖØÐ´¹æÔòÔÚ´ËÍ£Ö¹ÖØÐ´½ø³Ì£¬Ê¹ÓÃÕâ¸öFLAGÒÔ×èÖ¹µ±Ç°±»ÖØÐ´µÄURI±»ºóÃæµÄ¹æÔòÔÙ´ÎÖØÐ´
N (Next iteration)
Ç¿ÖÆREWRITINGENGINEµ÷Õû¹æÔòÄ¿±ê²¢ÇÒ´ÓÍ·ÖØÆô¹æÔò¼ì²é£¨ËùÓÐÐ޸Ľ«±£´æ£©£¬ÖØÆô´ÎÊýÓÉRepeatLimitÖ¸¶¨µÄÖµÏÞÖÆ£¬Èç¹ûÕâ¸öÊýÖµ³¬¹ýN FLAG½«±»ºöÂÔ
NS (Next iteration of the same rule)
ÒÔN±ê¼Ç¹¤×÷²»´ÓÏàͬµÄ¹æÔòÖØÆô¹æÔò¹æÔò½ø³Ì£¨ÀýÈçÇ¿ÖÆÖØ¸´¹æÔòÓ¦Óã©£¬Í¨¹ýRepeatLimitÖ¸ÁîÖ¸¶¨Ò»¸ö·´¸´ÊµÐÐijһ¹æÔòµÄ×î´óÊýÄ¿£¬
P (force proxy)
Ç¿ÖÆÄ¿µÄURIÔÚÄÚ²¿Ç¿ÖÆÎª´úÀíÐèÇó²¢ÇÒÁ¢¼´Í¨¹ýISAPIÀ©Õ¹Ó¦¸¶´úÀíÐèÇ󣬱ØÐëÈ·ÈÏ´úÀí×Ö·û´®ÊÇÒ»¸öÓÐЧµÄURI°üÀ¨Ð­Òé Ö÷»úµÈµÈ·ñÔò´úÀí½«·µ»Ø´íÎó
R (explicit redirect£©
Ç¿ÖÆ·þÎñÆ÷¶Ô¿Í»§¶Ë·¢³öÖØ¶¨Ïòָʾ¼´Ê±Ó¦´ð£¬ÌṩĿµÄURIµÄеØÖ·£¬Öض¨Ïò¹æÔò¾­³£ÊÇ×îºó¹æÔò
RP (permanent redirect)
¼¸ºõºÍ[R]±ê¼ÇÏàͬµ«ÊÇ·¢²¼301HTTP״̬¶ø²»ÊÇ302HTTP״̬´úÂë
U (Unmangle Log)
µ±URIÊÇÔ´ÐèÇó¶ø²»ÊÇÖØÐ´ÐèÇóʱ¼ÇÔØURI
O (nOrmalize)
ÔÚʵÐÐ֮ǰ±ê×¼»¯×Ö·û´®¡£±ê×¼»¯°üÀ¨URL-ENCODING£¬²»ºÏ·¨µÄ×Ö·ûµÄÔÙÒÆ¶¯µÈ£¬Õâ¸ö±ê¼Ç¶ÔÓÚURLSºÍURLS-ENDODEDÍ·ÊÇÓÐÓõÄ
CL (Case Lower)
Сд
CU (Case Upper)
´óд
RewriteHeader directive
Syntax: RewriteHeader HeaderName Pattern FormatString [Flags]
Õâ¸öÖ¸ÁîÊÇRewriteRuleµÄ¸ü¸ÅÀ¨»¯±äÖÖ£¬Ëü²»½öÖØÐ´URLµÄ¿Í»§¶ËÐèÇ󲿷֣¬¶øÇÒÖØÐ´HTTPÍ·£¬Õâ¸öÖ¸Áî²»½öÓÃÓÚÖØÐ´¡£Éú³É£¬É¾³ýÈκÎHTTPÍ·£¬ÉõÖÁ¸Ä±ä¿Í»§¶ËÇëÇóµÄ·½·¨
HeaderName
Ö¸¶¨½«±»ÖØÐ´µÄ¿Í»§Í·£¬¿ÉÈ¡µÄÖµÓë RewriteCond Ö¸ÁîÖÐTestVerb²ÎÊýÏàͬ

Pattern
ÏÞ¶¨¹æÔò±í´ïʽÒÔÆ¥ÅäRequest-URI£¬
FormatString
ÏÞ¶¨½«Éú³ÉеÄURIµÄFormatString
[Flags]
ÊÇÒ»¸öÏÂÁÐFLAGSµÄÃüÁî·Ö¸ôÁбí
I (ignore case£©
²»¹Ü´óСдǿÐÐÖ¸¶¨×Ö·ûÆ¥Å䣬Õâ¸öFLAGÓ°ÏìRewriteRuleÖ¸ÁîºÍÏàÓ¦µÄRewriteCond Ö¸Áî
F (Forbidden)
¶Ô¿Í»§¶Ë×ö·´Ó¦£¬Í£Ö¹REWRITING½ø³Ì²¢ÇÒ·¢ËÍ403´íÎó£¬×¢ÒâÔÚÕâÖÖÇé¿öÏÂFORMATSTRING ÊÇÎÞÓõIJ¢¿ÉÒÔÉèÖÃΪÈκηǿÕ×Ö·û´®¡£
L (last rule)
²»Ó¦ÓÃÈκÎÖØÐ´¹æÔòÔÚ´ËÍ£Ö¹ÖØÐ´½ø³Ì£¬Ê¹ÓÃÕâ¸öFLAGÒÔ×èÖ¹µ±Ç°±»ÖØÐ´µÄURI±»ºóÃæµÄ¹æÔòÔÙ´ÎÖØÐ´
N (Next iteration)
Ç¿ÖÆREWRITINGENGINEµ÷Õû¹æÔòÄ¿±ê²¢ÇÒ´ÓÍ·ÖØÆô¹æÔò¼ì²é£¨ËùÓÐÐ޸Ľ«±£´æ£©£¬ÖØÆô´ÎÊýÓÉRepeatLimitÖ¸¶¨µÄÖµÏÞÖÆ£¬Èç¹ûÕâ¸öÊýÖµ³¬¹ýN FLAG½«±»ºöÂÔ

NS (Next iteration of the same rule)
ÒÔN±ê¼Ç¹¤×÷²»´ÓÏàͬµÄ¹æÔòÖØÆô¹æÔò¹æÔò½ø³Ì£¨ÀýÈçÇ¿ÖÆÖØ¸´¹æÔòÓ¦Óã©£¬Í¨¹ýRepeatLimitÖ¸ÁîÖ¸¶¨Ò»¸ö·´¸´ÊµÐÐijһ¹æÔòµÄ×î´óÊýÄ¿£¬

R (explicit redirect£©
Ç¿ÖÆ·þÎñÆ÷¶Ô¿Í»§¶Ë·¢³öÖØ¶¨Ïòָʾ¼´Ê±Ó¦´ð£¬ÌṩĿµÄURIµÄеØÖ·£¬Öض¨Ïò¹æÔò¾­³£ÊÇ×îºó¹æÔò
RP (permanent redirect)
¼¸ºõºÍ[R]±ê¼ÇÏàͬµ«ÊÇ·¢²¼301HTTP״̬¶ø²»ÊÇ302HTTP״̬´úÂë
U (Unmangle Log)
µ±URIÊÇÔ´ÐèÇó¶ø²»ÊÇÖØÐ´ÐèÇóʱ¼ÇÔØURI
O (nOrmalize)
ÔÚʵÐÐ֮ǰ±ê×¼»¯×Ö·û´®¡£±ê×¼»¯°üÀ¨URL-ENCODING£¬²»ºÏ·¨µÄ×Ö·ûµÄÔÙÒÆ¶¯µÈ£¬Õâ¸ö±ê¼Ç¶ÔÓÚURLSºÍURLS-ENDODEDÍ·ÊÇÓÐÓõÄ
CL (Case Lower)
Сд
CU (Case Upper)
´óд

ÒªÖØÒÆ¶¯Í·£¬FORMAT STRINGģʽӦ¸ÃÉú³ÉÒ»¸ö¿Õ×Ö·û´®£¬ÀýÈçÕâÒ»¹æÔò½«´Ó¿Í»§ÇëÇóÖÐÖØÒÆ´úÀíÐÅÏ¢
RewriteHeader User-Agent: .* $0
²¢ÇÒÕâÒ»¹æÔò½«°ÑOLD-URL HEADER ¼ÓÈëÇëÇóÖС£
RewriteCond URL (.*)RewriteHeader Old-URL: ^$ $1
×îºóÒ»¸öÀý×Ó½«Í¨¹ý¸Ä±äÇëÇó·½·¨¶¨ÏòËùÓеÄWEBDAVÇëÇóµ½/WEBDAV¡£ASP
RewriteCond METHOD OPTIONS
RewriteRule (.*) /webdav.asp?$1
RewriteHeader METHOD OPTIONS GET
RewriteProxy directive
Syntax: RewriteProxy Pattern FormatString [Flags]
Ç¿ÖÆÄ¿µÄURIÔÚÄÚ²¿Ç¿ÖÆÎª´úÀíÐèÇó²¢ÇÒÁ¢¼´Í¨¹ýISAPIÀ©Õ¹Ó¦¸¶´úÀíÐèÇó£¬Õ⽫ÔÊÐíIIS×÷Ϊ´úÀí·þÎñÆ÷²¢ÇÒÖØÂ·Óɵ½ÆäËûÕ¾µãºÍ·þÎñÆ÷
Pattern
ÏÞ¶¨¹æÔò±í´ïʽÒÔÆ¥ÅäRequest-URI£¬
FormatString
ÏÞ¶¨½«Éú³ÉеÄURIµÄFormatString
[Flags]
ÊÇÒ»¸öÏÂÁÐFLAGSµÄÃüÁî·Ö¸ôÁбí
D (Delegate security)
´úÀíģʽ½«ÊÔͼÒÔµ±Ç°¼ÙðµÄÓû§×ʸñµÇ½Զ³Ì·þÎñÆ÷£¬
C (use Credentials)
´úÀíģʽ½«ÊÔͼһÔÚURL»ò»ù±¾ÊÚȨͷÎļþÖÐÖ¸¶¨µÄ×ʸñµÇ½Զ³Ì·þÎñÆ÷£¬ÓÃÕâ¸ö±ê¼ÇÄã¿ÉÒÔʹÓÃhttp://user:password@host.com/path/ syntax ×÷ΪURL
F (Follow redirects)
ȱʡÇé¿öÏÂISAPI_Rewrite ½«ÊÔͼ½«MAPÔ¶³Ì·þÎñÆ÷·µ»ØµÄÖØ¶¨ÏòÖ¸Áîµ½±¾µØ·þÎñÆ÷ÃüÃû¿Õ¼ä£¬Èç¹ûÔ¶³Ì·þÎñÆ÷·µ»ØÖض¨Ïòµãµ½ÄÇ̨·þÎñÆ÷ÆäËûµÄij¸öλÖã¬ISAPI_Rewrite ½«ÐÞ¸ÄÕâÒ»ÖØ¶¨ÏòÖ¸ÁîÖ¸Ïò±¾·þÎñÆ÷Ãû£¬Õ⽫±ÜÃâÓû§¿´µ½ÕæÊµ£¨ÄÚ²¿£©·þÎñÆ÷Ãû³Æ
ʹÓÃF±ê¼ÇÇ¿ÖÆ´úÀíģʽÄÚ²¿¸ú×ÙÔ¶³Ì·þÎñÆ÷·µ»ØµÄÖØ¶¨ÏòÖ¸ÁʹÓÃÕâ¸ö±ê¼ÇÈç¹ûÄã¸ù±¾²»ÐèÒª½ÓÊÜÔ¶³Ì·þÎñÆ÷µÄÖØ¶¨ÏòÖ¸ÁÔÚWINHTTPÉèÖÃÖÐÓÐÖØ¶¨ÏòÏÞÖÆÒÔ±ÜÃâÔ¶³ÌÖØ¶¨ÏòÑ­»·
I (ignore case)
²»¹Ü´óСдǿÐÐÖ¸¶¨×Ö·ûÆ¥Åä
U (Unmangle Log)
µ±URIÊÇÔ´ÐèÇó¶ø²»ÊÇÖØÐ´ÐèÇóʱ¼ÇÔØURI
O (nOrmalize)
ÔÚʵÐÐ֮ǰ±ê×¼»¯×Ö·û´®¡£±ê×¼»¯°üÀ¨URL-ENCODING£¬²»ºÏ·¨µÄ×Ö·ûµÄÔÙÒÆ¶¯µÈ£¬Õâ¸ö±ê¼Ç¶ÔÓÚURLSºÍURLS-ENDODEDÍ·ÊÇÓÐÓõÄ
CacheClockRate directive
Syntax: CacheClockRate Interval
Õâ¸öÖ¸ÁîÖ»ÔÚGLOBALÅäÖÃÄÚÈÝÖгöÏÖ£¬Èç¹ûÕâ¸öÖ¸ÁîÔÚSITE-LEVELÄÚÈÝÖгöÏÖ½«±»ºöÂÔ²¢°Ñ´íÎóÐÅϢдÈëhttpd.parse.errors Îļþ
ISAPI_Rewrite cachesÿ´ÎÔÚµÚÒ»´Î¼ÓÔØÊ±ÅäÖã¬Ê¹ÓÃÕâ¸öÖ¸ÁîÄã¿ÉÒÔÏÞ¶¨µ±Ò»¸öÌØ¶¨Õ¾µã´Ó»º´æÖÐÇåÀíµÄ²»»î¶¯ÖÜÆÚ£¬°ÑÕâ¸ö²ÎÊýÉèÖõÄ×ã¹»´óÄã¿ÉÒÔÇ¿ÖÆISAPI_Rewrite ÓÀ²»ÇåÀí»º´æ£¬¼ÇסÈκÎÅäÖÃÎļþµÄ¸Ä±ä½«ÔÚÏ´ÎÇëÇóºóÁ¢¼´¸üжøºöÂÔÕâ¸öÖÜÆÚ
Interval
ÏÞ¶¨Ìض¨ÅäÖñ»ÇåÀí³ö»º´æµÄ²»×÷Ϊʱ¼ä£¨ÒÔÃë¼Æ£©£¬È±Ê¡Öµ3600£¨1Сʱ£©
EnableConfig and DisableConfig directives
Syntax:
EnableConfig [SiteID|"Site name"]
DisableConfig [SiteID|"Site name"]
¶ÔËùѡվµã¼¤»î»ò²»¼¤»îSITE-LEVELÅäÖûòÕ߸ıäȱʡÅäÖã¬È±Ê¡SITE-LEVELÅäÖò»¼¤»î£¬Õâ¸öÖ¸ÁîÖ»³öÏÖÔÚGLOBALÅäÖÃÄÚÈÝÖÐ
SiteID
Numeric metabase identifier of a site

Site name
Name of the site as it appears in the IIS console
²»ÓòÎÊýʹÓÃÕâ¸öÃüÁ¸Ä±äȱʡÅäÖõ½ENABLE/DISABLEÅäÖýø³Ì
Àý×Ó
ÏÂÃæÀý×Ó½«Ê¹ÅäÖýö×÷ÓÃÓÚID=1£¨µäÐÍÊÇȱʡվµã£©Ãû×ÖÊÇMY SITEµÄÕ¾µã
DisableConfig
EnableConfig 1
EnableConfig"My site"
ϱßÀý×Ó½«¼¤»îÃû³ÆÎªSOMESITEÅäÖÃÒòΪËü·Ö¸îÉèÖÃÖØÔØÁËȱʡÉèÖÃ
EnableConfig"Some site"
DisableConfig
EnableRewrite and DisableRewrite directives
Syntax:
EnableRewrite [SiteID|"Site name"]
DisableRewrite [SiteID|"Site name"]
¶ÔËùѡվµã¼¤»î»ò²»¼¤»îÖØÐ´»òÕ߸ıäȱʡÅäÖã¬È±Ê¡ÖØÐ´ÅäÖü¤»î£¬Õâ¸öÖ¸ÁîÖ»³öÏÖÔÚGLOBALÅäÖÃÄÚÈÝÖÐ
SiteID
Numeric metabase identifier of a site

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

²»Ê¹ÓòÎÊýÕâ¸öÃüÁȫ²¿¼¤»î»òÕß²»¼¤»î
RepeatLimit directive
Syntax: RepeatLimit Limit
Õâ¸öÖ¸Áî¿ÉÒÔ³öÏÖÔÚGLOBALºÍSITE-LEVELÅäÖÃÎļþÖУ¬Èç¹û³öÏÖÔÚGLOBALÅäÖÃÎļþÖо¹¸Ä±äGLOBAL¶ÔÓÚËùÓÐÕ¾µãµÄÏÞÖÆ£¬³öÏÖÔÚSITE-LEVELÅäÖÃÖо¹Ö»¸Ä±ä¶ÔÓÚÕâ¸öÕ¾µãµÄÏÞÖÆ²¢ÇÒÕâ¸öÏÞÖÆ²»Äܳ¬¹ýGLOBALÏÞÖÆ
ISAPI_RewriteÔÚʵÐйæÔòʱÔÊÐíÑ­»·£¬Õâ¸öÖ¸ÁîÔÊÐíÏÞÖÆ×î´ó¿ÉÄÜÑ­»·µÄÊýÁ¿£¬¿ÉÒÔÉèÖÃΪ0»ò1¶ø²»Ö§³ÖÑ­»·£¬
LIMIT
ÏÞÖÆ×î´óÑ­»·ÊýÁ¿£¬È±Ê¡32
RFStyle directive
Syntax: RFStyle Old | New
Configuration Utility
ISAPI_Rewrite Full°üÀ¨ÅäÖù¦Ó㨿ÉÒÔÔÚ ISAPI_Rewrite ³ÌÐò×éÖÐÆô¶¯£©£¬ËüÔÊÐíÄãä¯ÀÀ²âÊÔ״̬²¢ÊäÈë×¢²áÂ루Èç¹ûÔÚ°²×°¹ý³ÌÖÐûÓÐ×¢²á£©£¬²¢ÇÒµ÷Õû²¿·ÖÓë´úÀíģʽ²Ù×÷Ïà¹ØµÄ²úÆ·¹¦ÄÜ£¬UTILITYÊÇÓÉÈý¸öÒ³Ãæ×é³ÉµÄÊôÐÔ±í
Trial pageÔÊÐíÄãä¯ÀÀTIRAL״̬²¢ÊäÈë×¢²áÂ루Èç¹ûÔÚ°²×°¹ý³ÌÖÐûÓÐ×¢²á£©
Settings page
ÕâÒ³°üº¬¶ÔÏÂÁвÎÊýµÄ±à¼­¿ò

Helper URL
Õâ¸ö²ÎÊýÓ°Ïì¹ýÂËÆ÷ºÍ´úÀíÄ£¿éÖ®¼äµÄÁªÏµ·½Ê½£¬Ëü¼´¿ÉÒÔÊÇÒÔµã×öǰ׺µÄÎļþÀ©Õ¹Ãû£¨Èç .isrwhlp£©Ò²¿ÉÒÔÊǾø¶Ô·¾¶£¬
µÚÒ»ÖÖÇé¿öÏÂÀ©Õ¹Ãû½«×·¼ÓÔÚ³õʼÇëÇóURIÉϲ¢ÇÒ´úÀíÄ£¿é¾¹Í¨¹ýSCRIPT MAP¼¤»î£¬È±Ê¡À©Õ¹ÃûisrwhlpÔÚ°²×°½ø³ÌÖмÓÔÚglobal script map ÖУ¬Èç¹ûÄã¸Ä±äÕâ¸öÀ©Õ¹Ãû»òÕßÄãµÄÓ¦Óò»¼Ì³Ðglobal script map ÉèÖÃÄãÓ¦¸ÃÊÖ¶¯Ìí¼ÓÏòscript map ËùÐèÇóµÄÈë¿Ú¡£Õâ¸öÓ¦¸ÃÓÐÈçϲÎÊý
Executable: An absolute path to the rwhelper.dll 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
ÎÒÃÇÒѾ­´´½¨ÁËÒ»¸öWSH script proxycfg.vbs £¬¿ÉÒÔ¼òµ¥ÔÚÒ»¸öa script mapsÖÐ×¢²á£¬ËýλÓÚ°²×°Îļþ¼Ð²¢ÇÒ¿ÉÒÔÔÚÃüÁîÐÐÒ»ÈçÏ·½Ê½ÔËÐÐ
cscript proxycfg.vbs [-r] [MetabasePath]
Optional -r Ç¿ÖÆ×¢²áÀ©Õ¹Ãû
Optional MetabasePath parameter allows specification of the first metabase key to process. By default it is "/localhost/W3SVC".
ÒªÔÚËùÓÐÏÖ´æµÄ script maps ÖÐ×¢²áÄã¿ÉÒÔÒÔÈçÏÂÃüÁîÐ줻î script
cscript proxycfg.vbs -r
µÚ¶þÖÖÇé¿öÏÂÄãÓ¦¸ÃÌṩһ¸öURI×÷Ϊ'Helper URL'µÄÖµ£¬ÄãÒ²Ó¦¸Ãmap Ò»¸ö ISAPI_RewriteµÄ°²×°Îļþ¼Ð×÷ΪÃÀÒâ¸öÕ¾µãµÄÐéÄâÎļþ¼Ò
×¢Ò⣺¸ù¾Ý¹Ë¿Í·´Ó¦£¬IIS5£¨Ò²Ðí°üÀ¨IIS4£©¶Ô³¤Ä¿Â¼ÃûÓÐÎÊÌâ¡£ËùÒÔÎÒÃÇÇ¿ÁÒÍÆ¼öʹÓöÌĿ¼Ãû
Worker threads limit
Õâ¸ö²ÎÊýÏÞÖÆÔÚ´úÀíÀ©Õ¹Ï̳߳ØÖй¤×÷Ïß³ÌÊý£¬È±Ê¡Îª0Òâζ×ÅÕâ¸öÏÞÖÆµÈÓÚ´¦ÀíÆ÷ÊýÁ¿³ËÒÔ2
Active threads limit
Õâ¸ö²ÎÊýÏÞÖÆµ±Ç°ÔËÐÐÏß³ÌÊý£¬Õâ¸öÊýÁ¿²»¿É´óÓÚ"Worker threads limit". ȱʡ0Òâ˼ÊǵÈÓÚ´¦ÀíÆ÷ÊýÁ¿
Queue size Õâ¸ö²ÎÊý¶¨Òå×î´óÇëÇóÊýÁ¿£¬Èç¹ûÄãÔø¾­¿´µ½Queue timeout expired" ÐÅÏ¢ÔÚ the Application event logÖÐÄã¿ÉÒÔÔö¼ÓÕâ¸ö²ÎÊý
Queue timeout
Õâ¸ö²ÎÊý¶¨ÒåÄãÔÚÄÚ²¿ÇëÇó¶ÓÁÐÖзÀÖ¹ÐÂÇëÇóµÄ×î´óµÈ´ýʱ¼ä£¬Èç¹ûÄãÔø¾­¿´µ½Queue timeout expired" ÐÅÏ¢ÔÚ the Application event logÖÐÄã¿ÉÒÔÔö¼ÓÕâ¸ö²ÎÊý
Connect timeout
ÒÔºÁÃëÉ趨´úÀíÄ£¿éÁ¬½Ó³¬Ê±
Send timeout
ÒÔºÁÃëÉ趨´úÀíÄ£¿é·¢Ëͳ¬Ê±
Receive timeout
ÒÔºÁÃëÉ趨´úÀíÄ£¿é·¢Ëͳ¬Ê±
About page.
It contains copyright information and a link to the ISAPI_Rewrite's web site.

Regular expression syntax
ÕâÒ»²¿·Ö¸²¸ÇÁË ISAPI_Rewrite¹æ¶¨µÄ±í´ï¾ä·¨
Literals
ËùÓÐ×Ö·û¶¼ÊÇÔ­Òâ³ýÁË ".", "*", "?", "+", "(", ")", "{", "}", "[", "]", "^" and "$".£¬ÕâЩ×Ö·ûÔÚÓá°\¡±´¦ÀíʱÊÇÔ­Ò⣬ԭÒâÖ¸Ò»¸ö×Ö·ûÆ¥Åä×ÔÉí
Wildcard
The dot character "." matches any single character except null character and newline character
ÒÔÏÂΪ¾ä·¨
Repeats
A repeat is an expression that is repeated an arbitrary number of times. An expression followed by "*" can be repeated any number of times including zero. An expression followed by "+" can be repeated any number of times, but at least once. An expression followed by "?" may be repeated zero or one times only. When it is necessary to specify the minimum and maximum number of repeats explicitly, the bounds operator "{}" may be used, thus "a{2}" is the letter "a" repeated exactly twice, "a{2,4}" represents the letter "a" repeated between 2 and 4 times, and "a{2,}" represents the letter "a" repeated at least twice with no upper limit. Note that there must be no white-space inside the {}, and there is no upper limit on the values of the lower and upper bounds. All repeat expressions refer to the shortest possible previous sub-expression: a single character; a character set, or a sub-expression grouped with "()" for example.

Examples:

"ba*" will match all of "b", "ba", "baaa" etc.
"ba+" will match "ba" or "baaaa" for example but not "b".
"ba?" will match "b" or "ba".
"ba{2,4}" will match "baa", "baaa" and "baaaa".
Non-greedy repeats
Non-greedy repeats are possible by appending a '?' after the repeat; a non-greedy repeat is one which will match the shortest possible string.

For example to match html tag pairs one could use something like:

"<\s*tagname[^>]*>(.*?)<\s*/tagname\s*>"

In this case $1 will contain the text between the tag pairs, and will be the shortest possible matching string.

Parenthesis
Parentheses serve two purposes, to group items together into a sub-expression, and to mark what generated the match. For example the expression "(ab)*" would match all of the string "ababab". All sub matches marked by parenthesis can be back referenced using \N or $N syntax. It is permissible for sub-expressions to match null strings. Sub-expressions are indexed from left to right starting from 1, sub-expression 0 is the whole expression.

Non-Marking Parenthesis
Sometimes you need to group sub-expressions with parenthesis, but don't want the parenthesis to spit out another marked sub-expression, in this case a non-marking parenthesis (?:expression) can be used. For example the following expression creates no sub-expressions:

"(?:abc)*"

Alternatives
Alternatives occur when the expression can match either one sub-expression or another, each alternative is separated by a "|". Each alternative is the largest possible previous sub-expression; this is the opposite behaviour from repetition operators.

Examples:

"a(b|c)" could match "ab" or "ac".
"abc|def" could match "abc" or "def".
Sets
A set is a set of characters that can match any single character that is a member of the set. Sets are delimited by "[" and "]" and can contain literals, character ranges, character classes, collating elements and equivalence classes. Set declarations that start with "^" contain the compliment of the elements that follow.

Examples:

Character literals:

"[abc]" will match either of "a", "b", or "c".
"[^abc] will match any character other than "a", "b", or "c".
Character ranges:

"[a-z]" will match any character in the range "a" to "z".
"[^A-Z]" will match any character other than those in the range "A" to "Z".
Character classes
Character classes are denoted using the syntax "[:classname:]" within a set declaration, for example "[[:space:]]" is the set of all whitespace characters. The available character classes are:

alnum Any alpha numeric character.
alpha Any alphabetical character a-z and A-Z. Other characters may also be included depending upon the locale.
blank Any blank character, either a space or a tab.
cntrl Any control character.
digit Any digit 0-9.
graph Any graphical character.
lower Any lower case character a-z. Other characters may also be included depending upon the locale.
print Any printable character.
punct Any punctuation character.
space Any whitespace character.
upper Any upper case character A-Z. Other characters may also be included depending upon the locale.
xdigit Any hexadecimal digit character, 0-9, a-f and A-F.
word Any word character - all alphanumeric characters plus the underscore.
unicode Any character whose code is greater than 255, this applies to the wide character traits classes only.

There are some shortcuts that can be used in place of the character classes:

\w in place of [:word:]
\s in place of [:space:]
\d in place of [:digit:]
\l in place of [:lower:]
\u in place of [:upper:]
Collating elements
Collating elements take the general form [.tagname.] inside a set declaration, where tagname is either a single character, or a name of a collating element, for example [[.a.]] is equivalent to [a], and [[.comma.]] is equivalent to [,]. ISAPI_Rewrite supports all the standard POSIX collating element names, and in addition the following digraphs: "ae", "ch", "ll", "ss", "nj", "dz", "lj", each in lower, upper and title case variations. Multi-character collating elements can result in the set matching more than one character, for example [[.ae.]] would match two characters, but note that [^[.ae.]] would only match one character.

Equivalence classes
Equivalenceclassestakethegeneralform[=tagname=] inside a set declaration, where tagname is either a single character, or a name of a collating element, and matches any character that is a member of the same primary equivalence class as the collating element [.tagname.]. An equivalence class is a set of characters that collate the same, a primary equivalence class is a set of characters whose primary sort key are all the same (for example strings are typically collated by character, then by accent, and then by case; the primary sort key then relates to the character, the secondary to the accentation, and the tertiary to the case). If there is no equivalence class corresponding to tagname, then [=tagname=] is exactly the same as [.tagname.].

To include a literal "-" in a set declaration then: make it the first character after the opening "[" or "[^", the endpoint of a range, a collating element, or precede it with an escape character as in "[\-]". To include a literal "[" or "]" or "^" in a set then make them the endpoint of a range, a collating element, or precede with an escape character.

Line anchors
An anchor is something that matches the null string at the start or end of a line: "^" matches the null string at the start of a line, "$" matches the null string at the end of a line.

Back references
A back reference is a reference to a previous sub-expression that has already been matched, the reference is to what the sub-expression matched, not to the expression itself. A back reference consists of the escape character "\" followed by a digit "1" to "9", "\1" refers to the first sub-expression, "\2" to the second etc. For example the expression "(.*)\1" matches any string that is repeated about its mid-point for example "abcabc" or "xyzxyz". A back reference to a sub-expression that did not participate in any match, matches the null string. In ISAPI_Rewrite all back references are global for entire RewriteRule and corresponding RewriteCond directives. Sub matches are numbered up to down and left to right beginning from the first RewriteCond directive of the corresponding RewriteRule directive, if there is one.

Forward Lookahead Asserts
There are two forms of these; one for positive forward lookahead asserts, and one for negative lookahead asserts:

"(?=abc)" matches zero characters only if they are followed by the expression "abc".
"(?!abc)" matches zero characters only if they are not followed by the expression "abc".

Word operators
The following operators are provided for compatibility with the GNU regular expression library.

"\w" matches any single character that is a member of the "word" character class, this is identical to the expression "[[:word:]]".
"\W" matches any single character that is not a member of the "word" character class, this is identical to the expression "[^[:word:]]".
"\<" matches the null string at the start of a word.
"\>" matches the null string at the end of the word.
"\b" matches the null string at either the start or the end of a word.
"\B" matches a null string within a word.
Escape operator
The escape character "\" has several meanings.

The escape operator may introduce an operator for example: back references, or a word operator.
The escape operator may make the following character normal, for example "\*" represents a literal "*" rather than the repeat operator.
Single character escape sequences:
The following escape sequences are aliases for single characters:


Escape sequence Character code Meaning
\a 0x07 Bell character.
\t 0x09 Tab character.
\v 0x0B Vertical tab.
\e 0x1B ASCII Escape character.
\0dd 0dd An octal character code, where dd is one or more octal digits.
\xXX 0xXX A hexadecimal character code, where XX is one or more hexadecimal digits.
\x{XX} 0xXX A hexadecimal character code, where XX is one or more hexadecimal digits, optionally a unicode character.
\cZ z-@ An ASCII escape sequence control-Z, where Z is any ASCII character greater than or equal to the character code for '@'.

Miscellaneous escape sequences:
The following are provided mostly for perl compatibility, but note that there are some differences in the meanings of \l \L \u and \U:

Escape sequence Meaning
\w Equivalent to [[:word:]].
\W Equivalent to [^[:word:]].
\s Equivalent to [[:space:]].
\S Equivalent to [^[:space:]].
\d Equivalent to [[:digit:]].
\D Equivalent to [^[:digit:]].
\l Equivalent to [[:lower:]].
\L Equivalent to [^[:lower:]].
\u Equivalent to [[:upper:]].
\U Equivalent to [^[:upper:]].
\C Any single character, equivalent to '.'.
\X Match any Unicode combining character sequence, for example "a\x 0301" (a letter a with an acute).
\Q The begin quote operator, everything that follows is treated as a literal character until a \E end quote operator is found.
\E The end quote operator, terminates a sequence begun with \Q.
What gets matched?
The regular expression will match the first possible matching string, if more than one string starting at a given location can match then it matches the longest possible string. In cases where their are multiple possible matches all starting at the same location, and all of the same length, then the match chosen is the one with the longest first sub-expression, if that is the same for two or more matches, then the second sub-expression will be examined and so on. Note that ISAPI_Rewrite uses MATCH algorithm. The result is matched only if the expression matches the whole input sequence. For example:

RewriteCond URL ^/somedir/.* #will match any request to somedir directory and subdirectories, while
RewriteCond URL ^/somedir/ #will match only request to the root of the somedir.
Special note about "pathological" regular expressions
ISAPI_Rewrite uses a very powerful regular expressions engine Regex++ written by Dr. John Maddock. But as any real thing it's not ideal: There exists some "pathological" expressions which may require exponential time for matching; these all involve nested repetition operators, for example attempting to match the expression "(a*a)*b" against N letter a's requires time proportional to 2N. These expressions can (almost) always be rewritten in such a way as to avoid the problem, for example "(a*a)*b" could be rewritten as "a*b" which requires only time linearly proportional to N to solve. In the general case, non-nested repeat expressions require time proportional to N2, however if the clauses are mutually exclusive then they can be matched in linear time - this is the case with "a*b", for each character the matcher will either match an "a" or a "b" or fail, where as with "a*a" the matcher can't tell which branch to take (the first "a" or the second) and so has to try both.

Boost 1.29.0 Regex++ could detect "pathological" regular expressions and terminate theirs matching. When a rule fails ISAPI_Rewrite sends "500 Internal Server error - Rule Failed" status to a client to indicate configuration error. Also the failed rule is disabled to prevent performance losses
Format string syntax
In format strings, all characters are treated as literals except: "(", ")", "$", "\", "?", ":".

To use any of these as literals you must prefix them with the escape character \

The following special sequences are recognized:

Grouping:
Use the parenthesis characters ( and ) to group sub-expressions within the format string, use \( and \) to represent literal '(' and ')'.

Sub-expression expansions:
The following perl like expressions expand to a particular matched sub-expression:

$` Expands to all the text from the end of the previous match to the start of the current match, if there was no previous match in the current operation, then everything from the start of the input string to the start of the match.
$' Expands to all the text from the end of the match to the end of the input string.
$& Expands to all of the current match.
$0 Expands to all of the current match.
$N Expands to the text that matched sub-expression N.

Conditional expressions:
Conditional expressions allow two different format strings to be selected dependent upon whether a sub-expression participated in the match or not:

?Ntrue_expression:false_expression

Executes true_expression if sub-expression N participated in the match, otherwise executes false_expression.

Example: suppose we search for "(while)|(for)" then the format string "?1WHILE:FOR" would output what matched, but in upper case.

Escape sequences:
The following escape sequences are also allowed:


\a The bell character.
\f The form feed character.
\n The newline character.
\r The carriage return character.
\t The tab character.
\v A vertical tab character.
\x A hexadecimal character - for example \x0D.
\x{} A possible unicode hexadecimal character - for example \x{1A0}
\cx The ASCII escape character x, for example \c@ is equivalent to escape-@.
\e The ASCII escape character.
\dd An octal character constant, for example \10
ExamplesÀý×Ó
Emulating host-header-based virtual sites on a single site
ÀýÈçÄãÔÚÁ½¸öÓòÃû×¢²áwww.site1.com ºÍ www.site2.com£¬ÏÖÔÚÄã¿ÉÒÔ´´½¨Á½¸ö²»Í¬µÄÕ¾µã¶øÊ¹Óõ¥Ò»µÄÎïÀíÕ¾µã¡£°ÑÒÔϹæÔò¼ÓÈëµ½ÄãµÄhttpd.ini Îļþ
[ISAPI_Rewrite]

#Fix missing slash char on folders
RewriteCond Host: (.*)
RewriteRule ([^.?]+[^.?/]) http\://$1$2/ [I,R]

#Emulate site1
RewriteCond Host: (?:www\.)?site1\.com
RewriteRule (.*) /site1$1 [I,L]

#Emulate site2
RewriteCond Host: (?:www\.)?site2\.com
RewriteRule (.*) /site2$1 [I,L]


ÏÖÔÚÄã¿ÉÒÔ°ÑÄãµÄÕ¾µã·ÅÔÚ/site1 ºÍ /site2 Ŀ¼ÖÐ.

»òÕßÄã¿ÉÒÔÓ¦Óøü¶àµÄÀà¹æÔò£º
[ISAPI_Rewrite]

#Fix missing slash char on folders
RewriteCond Host: (.*)
RewriteRule ([^.?]+[^.?/]) http\://$1$2/ [I,R]

RewriteCond Host: (www\.)?(.+)
RewriteRule (.*) /$2$3
ΪվµãÓ¦¸ÃÃüÃûĿ¼Ϊ /somesite1.com, /somesite2.info, etc.
Using loops (Next flag) to convert request parameters
¼ÙÈçÄãÏ£ÍûÓÐÎïÀíURLÈç http://www.myhost.com/foo.asp?a=A&b=B&c=C ʹÓÃÇëÇóÈç http://www.myhost.com/foo.asp/a/A/b/B/c/C ²ÎÊýÊýÁ¿¿ÉÒÔ´ÓÁ½¸öÇëÇóÖ®¼ä±ä»¯

ÖÁÉÙÓÐÁ½¸ö½â¾ö°ì·¨¡£Äã¿ÉÒÔ¼òµ¥µÄΪÿһ¿ÉÄܵIJÎÊýÊýÁ¿Ìí¼ÓÒ»¸ö·Ö¸ô¹æÔò»òÕßÄã¿ÉÒÔʹÓÃÒ»¸ö¼¼Êõ˵Ã÷ÈçÏÂÃæµÄÀý×Ó
ISAPI_Rewrite]
RewriteRule (.*?\.asp)(\?[^/]*)?/([^/]*)/([^/]*)(.*) $1(?2$2&:\?)$3=$4$5 [NS,I]
Õâ¸ö¹æÔò½«´ÓÇëÇóµÄURLÖгéȡһ¸ö²ÎÊý×·¼ÓÔÚÇëÇó×Ö·ûµÄĩβ²¢ÇÒ´ÓÍ·ÖØÆô¹æÔò½ø³Ì¡£ËùÒÔËü½«Ñ­»·Ö±µ½ËùÓвÎÊý±»Òƶ¯µ½Êʵ±µÄλÖ㬻òÕßÖ±µ½³¬¹ýRepeatLimit
Ò²´æÔÚÐí¶àÕâ¸ö¹æÔòµÄ±äÖÖ¡£µ«Ê¹Óò»Í¬µÄ·Ö¸ô×Ö·û£¬ÀýÈ硣ʹÓÃURLSÈçhttp://www.myhost.com/foo.asp~a~A~b~B~c~C ¿ÉÒÔÓ¦ÖÐÏÂÃæµÄ¹æÔò£º
ISAPI_Rewrite]
RewriteRule (.*?\.asp)(\?[^~]*)?~([^~]*)~([^~]*)(.*) $1(?2$2&:\?)$3=$4$5 [NS,I]
Running servers behind IIS
¼ÙÈçÎÒÃÇÓÐÒ»¸öÄÚÍø·þÎñÆ÷ÔËÐÐIIS¶ø¼¸¸ö¹«Ë¾·þÎñÆ÷ÔËÐÐÆäËûƽ̨£¬ÕâЩ·þÎñÆ÷²»ÄÜ´ÓINTERNETÖ±½Ó½øÈ룬¶øÖ»ÄÜ´ÓÎÒÃǹ«Ë¾µÄÍøÂç½øÈ룬ÓÐÒ»¸ö¼òµ¥µÄÀý×Ó¿ÉÒÔʹÓôúÀí±ê¼ÇÓ³ÉäÆäËû·þÎñÆ÷µ½IISÃüÃû¿Õ¼ä£º
[ISAPI_Rewrite]
RewriteProxy /mappoint(.+) http\://sitedomain$1 [I,U]
Moving sites from UNIX to IIS
Õâ¸ö¹æÔò¿ÉÒÔ°ïÖúÄã°ÑURL´Ó /~username ¸Ä±äµ½ /username ºÍ´Ó /file.html ¸Ä±äµ½ /file.htm. Õâ¸öÔÚÄã½ö½ö°ÑÄãµÄÕ¾´ÓUNIXÒÆ¶¯µ½IIS²¢ÇÒ±£³ÖËÑË÷ÒýÇæºÍÆäËûÍâ²¿Ò³Ãæ¶ÔÀÏÒ³ÃæµÄÁ¬½ÓʱÊÇÓÐÓõÄ
[ISAPI_Rewrite]

#redirecting to update old links
RewriteRule (.*)\.html $1.htm
RewriteRule /~(.*) http\://myserver/$1 [R]
Moving site location
Ðí¶àÍø¹ÜÎÊÕâÑùµÄÎÊÌ⣺ËûÃÇÒªÖØ¶¨ÏòËùÓеÄÇëÇóµ½Ò»¸öеÄÍøÂç·þÎñÆ÷£¬µ±ÄãÐèÒª½¨Á¢Ò»¸ö¸üеÄÕ¾µãÈ¡´úÀϵĵÄʱºò¾­³£³öÏÖÕâÑùµÄÎÊÌ⣬½â¾ö·½°¸ÊÇÓÃISAPI_Rewrite ÓÚÀÏ·þÎñÆ÷ÖÐ
[ISAPI_Rewrite]

#redirecting to update old links
RewriteRule (.+) http\://newwebserver$1 [R]

Browser-dependent content
Dynamically generated robots.txt
robots.txtÊÇÒ»¸öËÑË÷ÒýÇæÓÃÀ´·¢ÏÖÄܲ»Äܱ»Ë÷ÒýµÄÎļþ£¬µ«ÊÇΪһ¸ö´óÕ¾´´½¨Ò»¸öÓÐÐí¶à¶¯Ì¬ÄÚÈݵÄÕâ¸öÎļþÊǺܸ´ÔӵŤ×÷£¬ÎÒÃÇ¿ÉÒÔдһ¸örobots.asp script

ÏÖÔÚʹÓõ¥Ò»¹æÔòÉú³É robots.txt
[ISAPI_Rewrite]

RewriteRule /robots\.txt /robots.asp
Making search engines to index dynamic pages
Õ¾µãµÄÄÚÈÝ´æ´¢ÔÚXMLÎļþÖУ¬ÔÚ·þÎñÆ÷ÉÏÓÐÒ»¸ö/XMLProcess.asp Îļþ´¦ÀíXMLÎļþ²¢·µ»ØHTMLµ½×îÖÕÓû§£¬URLSµ½ÎĵµÓÐÈçÏÂÐÎʽ
http://www.mysite.com/XMLProcess.asp?xml=/somdir/somedoc.xml
µ«ÊÇÐí¶à¹«¹²ÒýÇæ²»ÄÜË÷Òý´ËÀàÎĵµ£¬ÒòΪURLS°üº¬Îʺţ¨Îĵµ¶¯Ì¬Éú³É£©£¬
ISAPI_Rewrite¿ÉÒÔÍêÈ«Ïû³ýÕâ¸öÎÊÌâ
[ISAPI_Rewrite]

RewriteRule /doc(.*)\.htm /XMLProcess.asp\?xml=$1.xml
ÏÖÔÚʹÓÃÈçͬhttp://www.mysite.com/doc/somedir/somedoc.htmµÄURL½øÈëÎĵµ£¬ËÑË÷ÒýÇæ½«²»ÖªµÀ²»ÊÇsomedoc.htm Îļþ²¢ÇÒÄÚÈÝÊǶ¯Ì¬Éú³ÉµÄ
Negative expressions (NOT
ÓÐʱµ±Ä£Ê½²»Æ¥ÅäÄãÐèÒªÓ¦ÓùæÔò£¬ÕâÖÖÇé¿öÏÂÄã¿ÉÒÔʹÓÃÔÚ¹æÔò±í´ïʽÖгÆÎªForward Lookahead Asserts
ÀýÈçÄãÐèÒª²»Ê¹ÓÃIE°ÑËùÓÐÓû§Òƶ¯µ½±ðµÄµØµã
[ISAPI_Rewrite]
# Redirect all non Internet Explorer users
# to another location
RewriteCond User-Agent: (?!.*MSIE).*
RewriteRule (.*) /nonie$1
Dynamic authentification
ÀýÈçÎÒÃÇÔÚÕ¾µãÉÏÓÐһЩ³ÉÔ±Óò£¬ÎÒÃÇÔÚÕâ¸öÓòÉÏÐèÒªÃÜÂë±£»¤Îļþ¶øÎÒÃDz»Ï²»¶ÓÃBUILT-IN·þÎñÆ÷°²È«£¬Õâ¸öÇé¿öÏ¿ÉÒÔ½¨Á¢Ò»¸öASP½Å±¾£¨³ÆÎªproxy.asp£©£¬Õâ¸ö½Å±¾½«´úÀíËùÓÐÇëÇóµ½³ÉÔ±Óò²¢ÇÒ¼ì²éÇëÇóÔÊÐí£¬ÕâÀïÓÐÒ»¸ö¼òµ¥µÄÄ£°åÄã¿ÉÒԷŽøÄã×Ô¼ºµÄÊÚȨ´úÂë


ÏÖÔÚÎÒÃÇҪͨ¹ýÅäÖà ISAPI_Rewrite ͨ¹ýÕâ¸öÒ³Ãæ´úÀíÇëÇó:

[ISAPI_Rewrite]
# Proxy all requests through proxy.asp
RewriteRule /members(.+) /proxy.asp\?http\://mysite.com/members$1
Blocking inline-images (stop hot linking

¼ÙÉèÎÒÃÇÔÚhttp://www.mysite.com/ÏÂÓÐÐ©Ò³ÃæÓÐһЩÄÚÁª GIFͼƬºÜºÃ£¬ËûÈË¿ÉÒÔ²»Ö±½ÓЭÉÌͨ¹ýµÁÁ´µ½ËûÃǵÄÒ³ÃæÉÏ£¬ÎÒÃDz»Ï²»¶ÕâÑùÒòΪ¼Ó´óÁË·þÎñÆ÷Á÷Á¿
µ±ÎÒÃDz»ÄÜ100%±£»¤Í¼Æ¬£¬ÎÒÃÇÖÁÉÙ¿ÉÒÔÔÚä¯ÀÀÆ÷·¢ËÍÒ»¸öHTTP Referer headerµÄµØ·½ÏÞÖÆÕâÖÖÇé¿ö
[ISAPI_Rewrite]
RewriteCond Host: (.+)
RewriteCond Referer: (?!http://\1.*).*
RewriteRule .*\.(?:gif|jpg|png) /block.gif [I,O]
±¾Ìû×î½üÆÀ·Ö¼Ç¼£º
  • ÍþÍû:+3(Сº¢.) ¸Ðл·ÖÏí
  • ÍþÍû:1(ÏÐȤ)
  • PW¹Å¶­¼¶±¦±´
    ¼¶±ð: ×ܰæÖ÷
    ÌØÊâ¹±Ï×½± ²å¼þ´óʦ½± ÈÈÐÄÖúÈ˽±
    1Â¥  ·¢±íÓÚ: 2006-02-26 20:47
    ÔΡ£¾¹È»Ã»ÓÐÒ»¸öÕ¾³¤¿´£¬ÄãÃÇÔÚÌÖÂÛÇøÖÐÎÊÀ´ÎÊÈ¥£¬Õâ¸ö¾ÍÊÇ´ð°¸Ñ½¡£
    fmd
    ¿ª·¢ÍøÂç²Ù×÷ϵͳ
    ¼¶±ð: ËÄÐÇ»áÔ±
    2Â¥  ·¢±íÓÚ: 2006-02-26 20:49
    ¿´²»¶®°¡
    Ç×Éí¾­Àú£¬´ËÈËΪƭ×Ó£ºhellokittyè
    ¼¶±ð: ÐÂÊÖÉÏ·
    3Â¥  ·¢±íÓÚ: 2006-02-26 21:02
    ÕâÍæÒâÔç¶¼¿´¹ýÁË,¹Ø¼üµÄÎÊÌâÊÇÏÖÔÚÐèÒªÐÞ¸ÄÒ»²¿·ÖÂÛ̳´úÂë²Å¿ÉÒÔÔÚIISÏÂʵÏÖ¾²Ì¬»¯.

    ÎÒÕýÔÚÐÞ¸Ä,ÀÛ!!
    PW¹Å¶­¼¶±¦±´
    ¼¶±ð: ×ܰæÖ÷
    ÌØÊâ¹±Ï×½± ²å¼þ´óʦ½± ÈÈÐÄÖúÈ˽±
    4Â¥  ·¢±íÓÚ: 2006-02-26 21:32
    Quote:
    ÒýÓõÚ3Â¥spirit2005ÓÚ2006-02-26 21:02·¢±íµÄ¡°¡±:
    ÕâÍæÒâÔç¶¼¿´¹ýÁË,¹Ø¼üµÄÎÊÌâÊÇÏÖÔÚÐèÒªÐÞ¸ÄÒ»²¿·ÖÂÛ̳´úÂë²Å¿ÉÒÔÔÚIISÏÂʵÏÖ¾²Ì¬»¯.

    ÎÒÕýÔÚÐÞ¸Ä,ÀÛ!!

    ²»»á°É¡£Éý¼¶µ½22Èյİ汾ºóÔÚ·þÎñÆ÷×÷Ò»Á½ÐеÄÉ趨¾ÍOK
    vg6
    ¼¶±ð: ¶þÐÇ»áÔ±
    5Â¥  ·¢±íÓÚ: 2006-02-26 23:42
    Äã¸ø³öÒª°²×°µÄºÍ°²×°µÄ·½·¨£à£à
    ÐèÒªÐ޸ĵĵط½£àÎÒÏëÓиü¶àÈ˶¥£®£®£½¡¡£½
    ÓÎÏ·µã¿¨³öÊÛ.»¶Ó­¼ÓÃË.
    ¼¶±ð: ³õÀ´Õ§µ½
    6Â¥  ·¢±íÓÚ: 2006-02-27 00:23
    ²»Ã÷ѽ£¡
    sadfsdfsdf
    ¼¶±ð: Ò»ÐÇ»áÔ±
    7Â¥  ·¢±íÓÚ: 2006-02-27 06:13
    ºÜ¶àÈ˵ÄÂÛ̳¶¼ÊǿռäÉ̵Ŀռ䣬IIS²»ÊÇ×Ô¼º¿ÉÒÔÐ޸ĵģ¬ËùÒÔ´ó¼ÒÔÚÕÒÒ»ÖÖÐÞ¸ÄÂÛ̳³ÌÐò´ïµ½ÊµÏÖÕâһĿµÄµÄ;¾¶£¡
    ÎÒÊÇС裬»­Ã¼×îÅÂÎÒ£¡

    City Hunter
    ¼¶±ð: PW²å¼þÖ§³ÖÍŶÓ
    8Â¥  ·¢±íÓÚ: 2006-02-27 08:27
    ÓÐЩ¿´µÄ¶®

    ÓÐЩ¿´²»¶®
    »¶Ó­¼ÓÈëPHPblast Support Team ÍÅÌå
    ÓêÁÖľ·ç  ÓëÖÚ²»Í¬
    ¼¶±ð: ÉÌÒµ°æÓû§
    9Â¥  ·¢±íÓÚ: 2006-02-27 11:30
    ÔÚÂýÂýÏû»¯¡­¡­¡­¡­Ð»Ð»¶«ÉýÐÖµÜÀ²
    µÈºò»·¾³¶ÔËûµÄÊÂÒµÍêÈ«ÓÐÀû²Å¶¯ÊÖµÄÈË£¬½«ÓÀÔ¶²»»á³É¹¦¡£

    QUOTE:
    ÖØ½ðÕÐÆ¸¸ßÊÖ ¹²Ó®ÌìÏÂ