{"id":201,"date":"2011-11-07T12:06:18","date_gmt":"2011-11-07T12:06:18","guid":{"rendered":"757b505cfd34c64c85ca5b5690ee5293"},"modified":"2011-11-07T12:06:18","modified_gmt":"2011-11-07T12:06:18","slug":"","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/201","title":{"rendered":"ISAPI_rewrite\u4e2d\u6587\u624b\u518c"},"content":{"rendered":"<p>\u914d\u7f6e\uff1a<br \/>\n\u5728NT 2000<br \/>\nXP\u548c2003\u5e73\u53f0\u4e0a\uff0c\u5728\u7cfb\u7edf\u5e10\u6237\u4e0b\u5e94\u8be5INETINFO\u7a0b\u5e8f\u5e94\u8be5\u4e0eIIS5\u4ee5\u5171\u5b58\u6a21\u5f0f\u8fc7\u6ee4\u5668\u8fd0\u884c\u3002\u6240\u4ee5\u7cfb\u7edf\u5e10\u6237\u5e94\u8be5\u7ed9\u4e88\u5bf9\u6240\u6709\u7684ISAPI-<br \/>\nREWIRITE DLLS<br \/>\n\u548c\u6240\u6709\u7684HTTPD\u3002INI\u6587\u4ef6\u81f3\u5c11\u53ef\u8bfb\u6743\u9650\uff0c\u6211\u4eec\u4e5f\u63a8\u8350\u5bf9\u7ed9\u4e88\u7cfb\u7edf\u5e10\u6237\u5bf9\u4e8e\u6240\u6709\u5305\u62ecHTTPD\u3002INI\u6587\u4ef6\u7684\u6587\u4ef6\u5939\u7684\u53ef\u5199\u6743\u9650\uff0c\u8fd9\u5c06\u5141\u8bb8\u4ea7\u751fHTTP\u3002<br \/>\nPARSE\u3002ERRORS\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5305\u542b\u914d\u7f6e\u6587\u4ef6\u8bed\u6cd5\u9519\u8bef\u3002\u5bf9\u4e8ePROXY\u6a21\u5757\u4e5f\u9700\u8981\u989d\u5916\u7684\u6743\u9650\uff0c\u56e0\u4e3a\u5b83\u5c06\u8fd0\u884c\u4e8e\u8fde\u63a5\u6c60\u6216HIGH-ISPLATED<br \/>\n\u5e94\u7528\u6a21\u5f0f\uff0cIIS\u5e10\u6237\u5171\u4eab\u6c60\u548cHIGH-ISOLATION\u6c60\u5e94\u88ab\u7ed9\u4e88<br \/>\n\u5bf9RWHELPERE\u3002DLL\u7684\u53ef\u8bfb\u6743\u9650\u3002\u7f3a\u7701\u60c5\u51b5\u4e0bIWAM-\u300a\u8ba1\u7b97\u673a\u540d\u300b\u88ab\u7528\u4e8e\u6240\u6709\u7684\u6c60\uff0c\u5728\u76f8\u5e94\u7684COM+\u5e94\u7528\u8bbe\u7f6e\u4e2d\u5e94\u501f\u52a9<br \/>\nCOM+ADMINISTRATION MMC SNAP-IN\u5efa\u7acb\u6c60\u5e10\u6237<br \/>\n\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f\u5316\uff1a<\/p>\n<p>\u6709\u4e24\u79cd\u5f62\u5f0f\u7684\u914d\u7f6e\u6587\u4ef6<br \/>\n-GLOBAL\uff08SERVER-LEVEL\uff09\u548cINDIVIDUAL\uff08SITE-LEVAL\uff09\u6587\u4ef6\uff0cGLOBAL\u914d\u7f6e\u6587\u4ef6\u5e94\u88ab\u547d\u540d\u4e3aHTTPD.INI\u5e76<br \/>\n\u51fa\u73b0\u5728ISAPI-REWRITE\u5b89\u88c5\u76ee\u5f55\u4e2d\uff0c\u6587\u4ef6\u7684\u5feb\u6377\u65b9\u5f0f\u901a\u8fc7\u5f00\u59cb\u83dc\u5355\u63d0\u4f9b\uff0cINDIVIDUAL\u914d\u7f6e\u6587\u4ef6\u5e94\u540d\u4e3aHTTPD\u3002INI\u5e76\u4e14\u80fd\u591f\u51fa\u73b0\u5728\u865a<br \/>\n\u62df\u7ad9\u70b9\u7684\u7269\u7406\u6839\u76ee\u5f55\u4e2d\uff0c\u4e24\u79cd\u7c7b\u578b\u7684\u683c\u5f0f\u5316\u662f\u76f8\u540c\u7684\u5e76\u662f\u6807\u51c6\u7684WINDOWS\u3002INI\u6587\u4ef6\uff0c\u6240\u6709\u7684\u6307\u4ee4\u90fd\u5e94\u8be5\u653e\u5728\u8fd9\u4e00\u90e8\u5206\u5e76\u4e14\u6240\u6709\u6307\u4ee4\u90fd\u5e94\u8be5\u4ee5\u5206\u9694\u7ebf\u653e\u7f6e\uff0c<br \/>\n\u4efb\u4f55\u8fd9\u4e00\u90e8\u5206\u4ee5\u5916\u7684\u6587\u672c\u90fd\u5c06\u88ab\u5ffd\u7565<\/p>\n<p>HTTPD.INI\u6587\u4ef6\u793a\u4f8b<\/p>\n<p>[ISAPI_Rewrite]<\/p>\n<p># This is a comment<\/p>\n<p># 300 = 5 minutes<br \/>\nCacheClockRate 300<br \/>\nRepeatLimit 20<\/p>\n<p># Block external access to the httpd.ini and httpd.parse.errors files<br \/>\nRewriteRule \/httpd(?:.ini|.parse.errors) \/ [F,I,O]<\/p>\n<p># Block external access to the Helper ISAPI Extension<br \/>\nRewriteRule .*.isrwhlp \/ [F,I,O]<\/p>\n<p># Some custom rules<br \/>\nRewriteCond Host: (.+)<\/p>\n<p>RewriteCond \u6307\u4ee4<\/p>\n<p>Syntax:\uff08\u53e5\u6cd5\uff09 RewriteCond TestVerb CondPattern [Flags]<br \/>\n\u8fd9\u4e00\u6307\u4ee4\u5b9a\u4e49\u4e00\u4e2a\u6761\u4ef6\u89c4\u5219\uff0c\u5728 RewriteRule \u6216\u8005 RewriteHeader\u6216 RewriteProxy\u6307\u4ee4\u524d\u9884\u884cRewriteCond\u6307\u4ee4\uff0c\u540e\u9762\u7684\u89c4\u5219 \u53ea\u6709\u5b83\u7684\uff0c\u6a21\u5f0f\u5339\u914dURI\u7684\u5f53\u524d\u72b6\u6001\u5e76\u4e14\u989d\u5916\u7684\u6761\u4ef6\u4e5f\u88ab\u5e94\u7528\u624d\u4f1a\u88ab\u5e94\u7528\u3002<\/p>\n<p>TestVerb <\/p>\n<p>Specifies verb that will be matched against regular e\u00adxpression.<br \/>\n\u7279\u522b\u5b9a\u4e49\u7684\u52a8\u8bcd\u5339\u914d\u89c4\u5b9a\u7684\u8868\u8fbe\u5f0f<br \/>\nTestVerb=(URL | METHOD | VERSION | HTTPHeaderName: | %ServerVariable) where:<\/p>\n<p>URL - returns Request-URI of client request as described in RFC 2068 (HTTP 1.1); <br \/>\n\u8fd4\u56de\u5ba2\u6237\u7aef\u5728RFC2068\u4e2d\u63cf\u8ff0\u7684\u9700\u6c42\u7684Request-URI<br \/>\nMETHOD - returns HTTP method of client request (OPTIONS, GET, HEAD, POST, PUT, Delete or TRACE); <br \/>\n\u8fd4\u56de\u5ba2\u6237\u7aef\u9700\u6c42(OPTIONS, GET, HEAD, POST, PUT, Delete or TRACE)\u7684HTTP\u65b9\u6cd5<br \/>\nVERSION - returns HTTP version; <br \/>\n\u8fd4\u56deHTTP\u7248\u672c<br \/>\nHTTPHeaderName<br \/>\n - returns value of the specified HTTP header. HTTPHeaderName can be any<br \/>\n valid HTTP header name. Header names should include the trailing colon<br \/>\n\":\". If specified header does not exists in a client's request TestVerb<br \/>\nis treated as empty string. <br \/>\n\u8fd4\u56de\u7279\u5b9a\u4e49\u7684HTTP\u5934\u6587\u4ef6\u7684\u503c<br \/>\nHTTPHeaderName = <br \/>\nAccept:<br \/>\nAccept-Charset:<br \/>\nAccept-Encoding:<br \/>\nAccept-Language:<br \/>\nAuthorization:<br \/>\nCookie:<br \/>\nFrom:<br \/>\nHost:<br \/>\nIf-Modified-Since:<br \/>\nIf-Match:<br \/>\nIf-None-Match:<br \/>\nIf-Range:<br \/>\nIf-Unmodified-Since:<br \/>\nMax-Forwards:<br \/>\nProxy-Authorization:<br \/>\nRange:<br \/>\nReferer:<br \/>\nUser-Agent:<br \/>\nAny-Custom-Header<br \/>\n\u5f97\u5230\u66f4\u591a\u7684\u5173\u4e8eHTTP\u5934\u6587\u4ef6\u7684\u548c\u4ed6\u4eec\u7684\u503c\u7684\u4fe1\u606f\u53c2\u8003RFC2068<\/p>\n<p>\nServerVariable \u8fd4\u56de\u7279\u5b9a\u4e49\u7684\u670d\u52a1\u5668\u53d8\u91cf\u7684\u503c \u3002\u4f8b\u5982\u670d\u52a1\u5668\u7aef\u53e3\uff0c\u5168\u90e8\u670d\u52a1\u5668\u53d8\u91cf\u5217\u8868\u5e94\u5728IIS\u6587\u6863\u4e2d\u5efa\u7acb\uff0c\u53d8\u91cf\u540d\u5e94\u7528%\u7b26\u9884\u5b9a\uff1b<br \/>\nCondPattern <br \/>\nThe regular e\u00adxpression to match TestVerb<br \/>\n\u89c4\u5219\u8868\u8fbe\u5f0f\u5339\u914dTestVerb<br \/>\n[Flags]<br \/>\nFlags is a comma-separated list of the following flags:<\/p>\n<p>O (nOrmalize) <br \/>\nNormalizes<br \/>\n string before processing. Normalization includes removing of an<br \/>\nURL-encoding, illegal characters, etc. This flag is useful with URLs and<br \/>\n URL-encoded headers<br \/>\nRewriteRule \u6307\u4ee4<br \/>\nSyntax: RewriteRule Pattern FormatString [Flags]<br \/>\n\u8fd9\u4e2a\u6307\u4ee4\u53ef\u4ee5\u4e0d\u6b62\u53d1\u751f\u4e00\u6b21\uff0c\u6bcf\u4e2a\u6307\u4ee4\u5b9a\u4e49\u4e00\u4e2a\u5355\u72ec\u7684\u91cd\u5199\u89c4\u5219\uff0c\u8fd9\u4e9b\u89c4\u5219\u7684\u5b9a\u4e49\u547d\u4ee4\u5f88\u91cd\u8981\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u547d\u4ee4\u5728\u5e94\u7528\u8fd0\u884c\u65f6\u89c4\u5219\u662f\u6709\u7528\u9014\u7684<\/p>\n<p>I (ignore case\uff09<br \/>\n\u4e0d\u7ba1\u5927\u5c0f\u5199\u5f3a\u884c\u6307\u5b9a\u5b57\u7b26\u5339\u914d\uff0c\u8fd9\u4e2aFLAG\u5f71\u54cdRewriteRule\u6307\u4ee4\u548c\u76f8\u5e94\u7684RewriteCond \u6307\u4ee4<br \/>\nF (Forbidden)<br \/>\n\u5bf9\u5ba2\u6237\u7aef\u505a\u53cd\u5e94\uff0c\u505c\u6b62REWRITING\u8fdb\u7a0b\u5e76\u4e14\u53d1\u9001403\u9519\u8bef\uff0c\u6ce8\u610f\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0bFORMATSTRING \u662f\u65e0\u7528\u7684\u5e76\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\u4efb\u4f55\u975e\u7a7a\u5b57\u7b26\u4e32\u3002<br \/>\nL (last rule)<br \/>\n\u4e0d\u5e94\u7528\u4efb\u4f55\u91cd\u5199\u89c4\u5219\u5728\u6b64\u505c\u6b62\u91cd\u5199\u8fdb\u7a0b\uff0c\u4f7f\u7528\u8fd9\u4e2aFLAG\u4ee5\u963b\u6b62\u5f53\u524d\u88ab\u91cd\u5199\u7684URI\u88ab\u540e\u9762\u7684\u89c4\u5219\u518d\u6b21\u91cd\u5199<br \/>\nN (Next iteration)<br \/>\n\u5f3a\u5236REWRITINGENGINE\u8c03\u6574\u89c4\u5219\u76ee\u6807\u5e76\u4e14\u4ece\u5934\u91cd\u542f\u89c4\u5219\u68c0\u67e5\uff08\u6240\u6709\u4fee\u6539\u5c06\u4fdd\u5b58\uff09\uff0c\u91cd\u542f\u6b21\u6570\u7531RepeatLimit\u6307\u5b9a\u7684\u503c\u9650\u5236\uff0c\u5982\u679c\u8fd9\u4e2a\u6570\u503c\u8d85\u8fc7N FLAG\u5c06\u88ab\u5ffd\u7565<br \/>\nNS (Next iteration of the same rule)<br \/>\n\u4ee5N\u6807\u8bb0\u5de5\u4f5c\u4e0d\u4ece\u76f8\u540c\u7684\u89c4\u5219\u91cd\u542f\u89c4\u5219\u89c4\u5219\u8fdb\u7a0b\uff08\u4f8b\u5982\u5f3a\u5236\u91cd\u590d\u89c4\u5219\u5e94\u7528\uff09\uff0c\u901a\u8fc7RepeatLimit\u6307\u4ee4\u6307\u5b9a\u4e00\u4e2a\u53cd\u590d\u5b9e\u884c\u67d0\u4e00\u89c4\u5219\u7684\u6700\u5927\u6570\u76ee\uff0c<br \/>\nP (force proxy) <br \/>\n\u5f3a\u5236\u76ee\u7684URI\u5728\u5185\u90e8\u5f3a\u5236\u4e3a\u4ee3\u7406\u9700\u6c42\u5e76\u4e14\u7acb\u5373\u901a\u8fc7ISAPI\u6269\u5c55\u5e94\u4ed8\u4ee3\u7406\u9700\u6c42\uff0c\u5fc5\u987b\u786e\u8ba4\u4ee3\u7406\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6709\u6548\u7684URI\u5305\u62ec\u534f\u8bae \u4e3b\u673a\u7b49\u7b49\u5426\u5219\u4ee3\u7406\u5c06\u8fd4\u56de\u9519\u8bef<br \/>\nR (explicit redirect\uff09<br \/>\n\u5f3a\u5236\u670d\u52a1\u5668\u5bf9\u5ba2\u6237\u7aef\u53d1\u51fa\u91cd\u5b9a\u5411\u6307\u793a\u5373\u65f6\u5e94\u7b54\uff0c\u63d0\u4f9b\u76ee\u7684URI\u7684\u65b0\u5730\u5740\uff0c\u91cd\u5b9a\u5411\u89c4\u5219\u7ecf\u5e38\u662f\u6700\u540e\u89c4\u5219<br \/>\nRP (permanent redirect)<br \/>\n\u51e0\u4e4e\u548c[R]\u6807\u8bb0\u76f8\u540c\u4f46\u662f\u53d1\u5e03301HTTP\u72b6\u6001\u800c\u4e0d\u662f302HTTP\u72b6\u6001\u4ee3\u7801<br \/>\nU (Unmangle Log)<br \/>\n\u5f53URI\u662f\u6e90\u9700\u6c42\u800c\u4e0d\u662f\u91cd\u5199\u9700\u6c42\u65f6\u8bb0\u8f7dURI<br \/>\nO (nOrmalize)<br \/>\n\u5728\u5b9e\u884c\u4e4b\u524d\u6807\u51c6\u5316\u5b57\u7b26\u4e32\u3002\u6807\u51c6\u5316\u5305\u62ecURL-ENCODING\uff0c\u4e0d\u5408\u6cd5\u7684\u5b57\u7b26\u7684\u518d\u79fb\u52a8\u7b49\uff0c\u8fd9\u4e2a\u6807\u8bb0\u5bf9\u4e8eURLS\u548cURLS-ENDODED\u5934\u662f\u6709\u7528\u7684 <br \/>\nCL (Case Lower) <br \/>\n\u5c0f\u5199<br \/>\nCU (Case Upper) <br \/>\n\u5927\u5199<br \/>\nRewriteHeader directive<br \/>\nSyntax: RewriteHeader HeaderName Pattern FormatString [Flags] <br \/>\n\u8fd9\u4e2a\u6307\u4ee4\u662fRewriteRule\u7684\u66f4\u6982\u62ec\u5316\u53d8\u79cd\uff0c\u5b83\u4e0d\u4ec5\u91cd\u5199URL\u7684\u5ba2\u6237\u7aef\u9700\u6c42\u90e8\u5206\uff0c\u800c\u4e14\u91cd\u5199HTTP\u5934\uff0c\u8fd9\u4e2a\u6307\u4ee4\u4e0d\u4ec5\u7528\u4e8e\u91cd\u5199\u3002\u751f\u6210\uff0c\u5220\u9664\u4efb\u4f55HTTP\u5934\uff0c\u751a\u81f3\u6539\u53d8\u5ba2\u6237\u7aef\u8bf7\u6c42\u7684\u65b9\u6cd5<br \/>\nHeaderName <br \/>\n\u6307\u5b9a\u5c06\u88ab\u91cd\u5199\u7684\u5ba2\u6237\u5934\uff0c\u53ef\u53d6\u7684\u503c\u4e0e RewriteCond \u6307\u4ee4\u4e2dTestVerb\u53c2\u6570\u76f8\u540c<\/p>\n<p>Pattern<br \/>\n\u9650\u5b9a\u89c4\u5219\u8868\u8fbe\u5f0f\u4ee5\u5339\u914dRequest-URI\uff0c<br \/>\nFormatString <br \/>\n\u9650\u5b9a\u5c06\u751f\u6210\u65b0\u7684URI\u7684FormatString <br \/>\n[Flags]<br \/>\n\u662f\u4e00\u4e2a\u4e0b\u5217FLAGS\u7684\u547d\u4ee4\u5206\u9694\u5217\u8868 <br \/>\nI (ignore case\uff09<br \/>\n\u4e0d\u7ba1\u5927\u5c0f\u5199\u5f3a\u884c\u6307\u5b9a\u5b57\u7b26\u5339\u914d\uff0c\u8fd9\u4e2aFLAG\u5f71\u54cdRewriteRule\u6307\u4ee4\u548c\u76f8\u5e94\u7684RewriteCond \u6307\u4ee4<br \/>\nF (Forbidden)<br \/>\n\u5bf9\u5ba2\u6237\u7aef\u505a\u53cd\u5e94\uff0c\u505c\u6b62REWRITING\u8fdb\u7a0b\u5e76\u4e14\u53d1\u9001403\u9519\u8bef\uff0c\u6ce8\u610f\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0bFORMATSTRING \u662f\u65e0\u7528\u7684\u5e76\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\u4efb\u4f55\u975e\u7a7a\u5b57\u7b26\u4e32\u3002<br \/>\nL (last rule)<br \/>\n\u4e0d\u5e94\u7528\u4efb\u4f55\u91cd\u5199\u89c4\u5219\u5728\u6b64\u505c\u6b62\u91cd\u5199\u8fdb\u7a0b\uff0c\u4f7f\u7528\u8fd9\u4e2aFLAG\u4ee5\u963b\u6b62\u5f53\u524d\u88ab\u91cd\u5199\u7684URI\u88ab\u540e\u9762\u7684\u89c4\u5219\u518d\u6b21\u91cd\u5199<br \/>\nN (Next iteration)<br \/>\n\u5f3a\u5236REWRITINGENGINE\u8c03\u6574\u89c4\u5219\u76ee\u6807\u5e76\u4e14\u4ece\u5934\u91cd\u542f\u89c4\u5219\u68c0\u67e5\uff08\u6240\u6709\u4fee\u6539\u5c06\u4fdd\u5b58\uff09\uff0c\u91cd\u542f\u6b21\u6570\u7531RepeatLimit\u6307\u5b9a\u7684\u503c\u9650\u5236\uff0c\u5982\u679c\u8fd9\u4e2a\u6570\u503c\u8d85\u8fc7N FLAG\u5c06\u88ab\u5ffd\u7565<\/p>\n<p>NS (Next iteration of the same rule)<br \/>\n\u4ee5N\u6807\u8bb0\u5de5\u4f5c\u4e0d\u4ece\u76f8\u540c\u7684\u89c4\u5219\u91cd\u542f\u89c4\u5219\u89c4\u5219\u8fdb\u7a0b\uff08\u4f8b\u5982\u5f3a\u5236\u91cd\u590d\u89c4\u5219\u5e94\u7528\uff09\uff0c\u901a\u8fc7RepeatLimit\u6307\u4ee4\u6307\u5b9a\u4e00\u4e2a\u53cd\u590d\u5b9e\u884c\u67d0\u4e00\u89c4\u5219\u7684\u6700\u5927\u6570\u76ee\uff0c<\/p>\n<p>R (explicit redirect\uff09<br \/>\n\u5f3a\u5236\u670d\u52a1\u5668\u5bf9\u5ba2\u6237\u7aef\u53d1\u51fa\u91cd\u5b9a\u5411\u6307\u793a\u5373\u65f6\u5e94\u7b54\uff0c\u63d0\u4f9b\u76ee\u7684URI\u7684\u65b0\u5730\u5740\uff0c\u91cd\u5b9a\u5411\u89c4\u5219\u7ecf\u5e38\u662f\u6700\u540e\u89c4\u5219<br \/>\nRP (permanent redirect)<br \/>\n\u51e0\u4e4e\u548c[R]\u6807\u8bb0\u76f8\u540c\u4f46\u662f\u53d1\u5e03301HTTP\u72b6\u6001\u800c\u4e0d\u662f302HTTP\u72b6\u6001\u4ee3\u7801<br \/>\nU (Unmangle Log)<br \/>\n\u5f53URI\u662f\u6e90\u9700\u6c42\u800c\u4e0d\u662f\u91cd\u5199\u9700\u6c42\u65f6\u8bb0\u8f7dURI<br \/>\nO (nOrmalize)<br \/>\n\u5728\u5b9e\u884c\u4e4b\u524d\u6807\u51c6\u5316\u5b57\u7b26\u4e32\u3002\u6807\u51c6\u5316\u5305\u62ecURL-ENCODING\uff0c\u4e0d\u5408\u6cd5\u7684\u5b57\u7b26\u7684\u518d\u79fb\u52a8\u7b49\uff0c\u8fd9\u4e2a\u6807\u8bb0\u5bf9\u4e8eURLS\u548cURLS-ENDODED\u5934\u662f\u6709\u7528\u7684 <br \/>\nCL (Case Lower) <br \/>\n\u5c0f\u5199<br \/>\nCU (Case Upper) <br \/>\n\u5927\u5199<\/p>\n<p>\u8981\u91cd\u79fb\u52a8\u5934\uff0cFORMAT STRING\u6a21\u5f0f\u5e94\u8be5\u751f\u6210\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982\u8fd9\u4e00\u89c4\u5219\u5c06\u4ece\u5ba2\u6237\u8bf7\u6c42\u4e2d\u91cd\u79fb\u4ee3\u7406\u4fe1\u606f<br \/>\nRewriteHeader User-Agent: .* $0<br \/>\n\u5e76\u4e14\u8fd9\u4e00\u89c4\u5219\u5c06\u628aOLD-URL HEADER \u52a0\u5165\u8bf7\u6c42\u4e2d\u3002<br \/>\nRewriteCond URL (.*)RewriteHeader Old-URL: ^$ $1<br \/>\n\u6700\u540e\u4e00\u4e2a\u4f8b\u5b50\u5c06\u901a\u8fc7\u6539\u53d8\u8bf7\u6c42\u65b9\u6cd5\u5b9a\u5411\u6240\u6709\u7684WEBDAV\u8bf7\u6c42\u5230\/WEBDAV\u3002ASP<br \/>\nRewriteCond METHOD OPTIONS<br \/>\nRewriteRule (.*) \/webdav.asp?$1<br \/>\nRewriteHeader METHOD OPTIONS GET<br \/>\nRewriteProxy directive<br \/>\nSyntax: RewriteProxy Pattern FormatString [Flags] <br \/>\n\u5f3a\u5236\u76ee\u7684URI\u5728\u5185\u90e8\u5f3a\u5236\u4e3a\u4ee3\u7406\u9700\u6c42\u5e76\u4e14\u7acb\u5373\u901a\u8fc7ISAPI\u6269\u5c55\u5e94\u4ed8\u4ee3\u7406\u9700\u6c42\uff0c\u8fd9\u5c06\u5141\u8bb8IIS\u4f5c\u4e3a\u4ee3\u7406\u670d\u52a1\u5668\u5e76\u4e14\u91cd\u8def\u7531\u5230\u5176\u4ed6\u7ad9\u70b9\u548c\u670d\u52a1\u5668<br \/>\nPattern<br \/>\n\u9650\u5b9a\u89c4\u5219\u8868\u8fbe\u5f0f\u4ee5\u5339\u914dRequest-URI\uff0c<br \/>\nFormatString <br \/>\n\u9650\u5b9a\u5c06\u751f\u6210\u65b0\u7684URI\u7684FormatString <br \/>\n[Flags]<br \/>\n\u662f\u4e00\u4e2a\u4e0b\u5217FLAGS\u7684\u547d\u4ee4\u5206\u9694\u5217\u8868<br \/>\nD (Delegate security) <br \/>\n\u4ee3\u7406\u6a21\u5f0f\u5c06\u8bd5\u56fe\u4ee5\u5f53\u524d\u5047\u5192\u7684\u7528\u6237\u8d44\u683c\u767b\u9646\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c<br \/>\nC (use Credentials) <br \/>\n\u4ee3\u7406\u6a21\u5f0f\u5c06\u8bd5\u56fe\u4e00\u5728URL\u6216\u57fa\u672c\u6388\u6743\u5934\u6587\u4ef6\u4e2d\u6307\u5b9a\u7684\u8d44\u683c\u767b\u9646\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u7528\u8fd9\u4e2a\u6807\u8bb0\u4f60\u53ef\u4ee5\u4f7f\u7528http:\/\/user:password@host.com\/path\/ syntax \u4f5c\u4e3aURL<br \/>\nF (Follow redirects)<br \/>\n\u7f3a\u7701\u60c5\u51b5\u4e0bISAPI_Rewrite \u5c06\u8bd5\u56fe\u5c06MAP\u8fdc\u7a0b\u670d\u52a1\u5668\u8fd4\u56de\u7684\u91cd\u5b9a\u5411\u6307\u4ee4\u5230\u672c\u5730\u670d\u52a1\u5668\u547d\u540d\u7a7a\u95f4\uff0c\u5982\u679c\u8fdc\u7a0b\u670d\u52a1\u5668\u8fd4\u56de\u91cd\u5b9a\u5411\u70b9\u5230\u90a3\u53f0\u670d\u52a1\u5668\u5176\u4ed6\u7684\u67d0\u4e2a\u4f4d\u7f6e\uff0cISAPI_Rewrite \u5c06\u4fee\u6539\u8fd9\u4e00\u91cd\u5b9a\u5411\u6307\u4ee4\u6307\u5411\u672c\u670d\u52a1\u5668\u540d\uff0c\u8fd9\u5c06\u907f\u514d\u7528\u6237\u770b\u5230\u771f\u5b9e\uff08\u5185\u90e8\uff09\u670d\u52a1\u5668\u540d\u79f0<br \/>\n\u4f7f\u7528F\u6807\u8bb0\u5f3a\u5236\u4ee3\u7406\u6a21\u5f0f\u5185\u90e8\u8ddf\u8e2a\u8fdc\u7a0b\u670d\u52a1\u5668\u8fd4\u56de\u7684\u91cd\u5b9a\u5411\u6307\u4ee4\uff0c\u4f7f\u7528\u8fd9\u4e2a\u6807\u8bb0\u5982\u679c\u4f60\u6839\u672c\u4e0d\u9700\u8981\u63a5\u53d7\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u91cd\u5b9a\u5411\u6307\u4ee4\uff0c\u5728WINHTTP\u8bbe\u7f6e\u4e2d\u6709\u91cd\u5b9a\u5411\u9650\u5236\u4ee5\u907f\u514d\u8fdc\u7a0b\u91cd\u5b9a\u5411\u5faa\u73af<br \/>\nI (ignore case) <br \/>\n\u4e0d\u7ba1\u5927\u5c0f\u5199\u5f3a\u884c\u6307\u5b9a\u5b57\u7b26\u5339\u914d <br \/>\nU (Unmangle Log)<br \/>\n\u5f53URI\u662f\u6e90\u9700\u6c42\u800c\u4e0d\u662f\u91cd\u5199\u9700\u6c42\u65f6\u8bb0\u8f7dURI<br \/>\nO (nOrmalize)<br \/>\n\u5728\u5b9e\u884c\u4e4b\u524d\u6807\u51c6\u5316\u5b57\u7b26\u4e32\u3002\u6807\u51c6\u5316\u5305\u62ecURL-ENCODING\uff0c\u4e0d\u5408\u6cd5\u7684\u5b57\u7b26\u7684\u518d\u79fb\u52a8\u7b49\uff0c\u8fd9\u4e2a\u6807\u8bb0\u5bf9\u4e8eURLS\u548cURLS-ENDODED\u5934\u662f\u6709\u7528\u7684<br \/>\nCacheClockRate directive<br \/>\nSyntax: CacheClockRate Interval <br \/>\n\u8fd9\u4e2a\u6307\u4ee4\u53ea\u5728GLOBAL\u914d\u7f6e\u5185\u5bb9\u4e2d\u51fa\u73b0\uff0c\u5982\u679c\u8fd9\u4e2a\u6307\u4ee4\u5728SITE-LEVEL\u5185\u5bb9\u4e2d\u51fa\u73b0\u5c06\u88ab\u5ffd\u7565\u5e76\u628a\u9519\u8bef\u4fe1\u606f\u5199\u5165httpd.parse.errors \u6587\u4ef6<br \/>\nISAPI_Rewrite<\/p>\n<p>caches\u6bcf\u6b21\u5728\u7b2c\u4e00\u6b21\u52a0\u8f7d\u65f6\u914d\u7f6e\uff0c\u4f7f\u7528\u8fd9\u4e2a\u6307\u4ee4\u4f60\u53ef\u4ee5\u9650\u5b9a\u5f53\u4e00\u4e2a\u7279\u5b9a\u7ad9\u70b9\u4ece\u7f13\u5b58\u4e2d\u6e05\u7406\u7684\u4e0d\u6d3b\u52a8\u5468\u671f\uff0c\u628a\u8fd9\u4e2a\u53c2\u6570\u8bbe\u7f6e\u7684\u8db3\u591f\u5927\u4f60\u53ef\u4ee5\u5f3a\u5236<br \/>\nISAPI_Rewrite \u6c38\u4e0d\u6e05\u7406\u7f13\u5b58\uff0c\u8bb0\u4f4f\u4efb\u4f55\u914d\u7f6e\u6587\u4ef6\u7684\u6539\u53d8\u5c06\u5728\u4e0b\u6b21\u8bf7\u6c42\u540e\u7acb\u5373\u66f4\u65b0\u800c\u5ffd\u7565\u8fd9\u4e2a\u5468\u671f<br \/>\nInterval <br \/>\n\u9650\u5b9a\u7279\u5b9a\u914d\u7f6e\u88ab\u6e05\u7406\u51fa\u7f13\u5b58\u7684\u4e0d\u4f5c\u4e3a\u65f6\u95f4\uff08\u4ee5\u79d2\u8ba1\uff09\uff0c\u7f3a\u7701\u503c3600\uff081\u5c0f\u65f6\uff09<br \/>\nEnableConfig and DisableConfig directives<br \/>\nSyntax:<br \/>\nEnableConfig [SiteID|\"Site name\"]<br \/>\nDisableConfig [SiteID|\"Site name\"] <br \/>\n\u5bf9\u6240\u9009\u7ad9\u70b9\u6fc0\u6d3b\u6216\u4e0d\u6fc0\u6d3bSITE-LEVEL\u914d\u7f6e\u6216\u8005\u6539\u53d8\u7f3a\u7701\u914d\u7f6e\uff0c\u7f3a\u7701SITE-LEVEL\u914d\u7f6e\u4e0d\u6fc0\u6d3b\uff0c\u8fd9\u4e2a\u6307\u4ee4\u53ea\u51fa\u73b0\u5728GLOBAL\u914d\u7f6e\u5185\u5bb9\u4e2d<br \/>\nSiteID <br \/>\nNumeric metabase identifier of a site<\/p>\n<p>Site name <br \/>\nName of the site as it appears in the IIS console<br \/>\n\u4e0d\u7528\u53c2\u6570\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u5c06\u6539\u53d8\u7f3a\u7701\u914d\u7f6e\u5230ENABLE\/DISABLE\u914d\u7f6e\u8fdb\u7a0b<br \/>\n\u4f8b\u5b50<br \/>\n\u4e0b\u9762\u4f8b\u5b50\u5c06\u4f7f\u914d\u7f6e\u4ec5\u4f5c\u7528\u4e8eID=1\uff08\u5178\u578b\u662f\u7f3a\u7701\u7ad9\u70b9\uff09\u540d\u5b57\u662fMY SITE\u7684\u7ad9\u70b9<br \/>\nDisableConfig<br \/>\nEnableConfig 1<br \/>\nEnableConfig\"My site\"<br \/>\n\u4e0b\u8fb9\u4f8b\u5b50\u5c06\u6fc0\u6d3b\u540d\u79f0\u4e3aSOMESITE\u914d\u7f6e\u56e0\u4e3a\u5b83\u5206\u5272\u8bbe\u7f6e\u91cd\u8f7d\u4e86\u7f3a\u7701\u8bbe\u7f6e<br \/>\nEnableConfig\"Some site\"<br \/>\nDisableConfig<br \/>\nEnableRewrite and DisableRewrite directives <br \/>\nSyntax:<br \/>\nEnableRewrite [SiteID|\"Site name\"]<br \/>\nDisableRewrite [SiteID|\"Site name\"] <br \/>\n\u5bf9\u6240\u9009\u7ad9\u70b9\u6fc0\u6d3b\u6216\u4e0d\u6fc0\u6d3b\u91cd\u5199\u6216\u8005\u6539\u53d8\u7f3a\u7701\u914d\u7f6e\uff0c\u7f3a\u7701\u91cd\u5199\u914d\u7f6e\u6fc0\u6d3b\uff0c\u8fd9\u4e2a\u6307\u4ee4\u53ea\u51fa\u73b0\u5728GLOBAL\u914d\u7f6e\u5185\u5bb9\u4e2d<br \/>\nSiteID <br \/>\nNumeric metabase identifier of a site<\/p>\n<p>Site name <br \/>\nName of the site as it appears in the IIS console.<\/p>\n<p>\u4e0d\u4f7f\u7528\u53c2\u6570\u8fd9\u4e2a\u547d\u4ee4\u5c06\u5168\u90e8\u6fc0\u6d3b\u6216\u8005\u4e0d\u6fc0\u6d3b<br \/>\nRepeatLimit directive<br \/>\nSyntax: RepeatLimit Limit <br \/>\n\u8fd9\u4e2a\u6307\u4ee4\u53ef\u4ee5\u51fa\u73b0\u5728GLOBAL\u548cSITE-LEVEL\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u5982\u679c\u51fa\u73b0\u5728GLOBAL\u914d\u7f6e\u6587\u4ef6\u4e2d\u7adf\u6539\u53d8GLOBAL\u5bf9\u4e8e\u6240\u6709\u7ad9\u70b9\u7684\u9650\u5236\uff0c\u51fa\u73b0\u5728SITE-LEVEL\u914d\u7f6e\u4e2d\u7adf\u53ea\u6539\u53d8\u5bf9\u4e8e\u8fd9\u4e2a\u7ad9\u70b9\u7684\u9650\u5236\u5e76\u4e14\u8fd9\u4e2a\u9650\u5236\u4e0d\u80fd\u8d85\u8fc7GLOBAL\u9650\u5236<br \/>\nISAPI_Rewrite\u5728\u5b9e\u884c\u89c4\u5219\u65f6\u5141\u8bb8\u5faa\u73af\uff0c\u8fd9\u4e2a\u6307\u4ee4\u5141\u8bb8\u9650\u5236\u6700\u5927\u53ef\u80fd\u5faa\u73af\u7684\u6570\u91cf\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e3a0\u62161\u800c\u4e0d\u652f\u6301\u5faa\u73af\uff0c<br \/>\nLIMIT<br \/>\n\u9650\u5236\u6700\u5927\u5faa\u73af\u6570\u91cf\uff0c\u7f3a\u770132<br \/>\nRFStyle directive<br \/>\nSyntax: RFStyle Old | New <br \/>\nConfiguration Utility<br \/>\nISAPI_Rewrite Full\u5305\u62ec\u914d\u7f6e\u529f\u7528\uff08\u53ef\u4ee5\u5728 ISAPI_Rewrite \u7a0b\u5e8f\u7ec4\u4e2d\u542f\u52a8\uff09\uff0c\u5b83\u5141\u8bb8\u4f60\u6d4f\u89c8\u6d4b\u8bd5\u72b6\u6001\u5e76\u8f93\u5165\u6ce8\u518c\u7801\uff08\u5982\u679c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u6ca1\u6709\u6ce8\u518c\uff09\uff0c\u5e76\u4e14\u8c03\u6574\u90e8\u5206\u4e0e\u4ee3\u7406\u6a21\u5f0f\u64cd\u4f5c\u76f8\u5173\u7684\u4ea7\u54c1\u529f\u80fd\uff0cUTILITY\u662f\u7531\u4e09\u4e2a\u9875\u9762\u7ec4\u6210\u7684\u5c5e\u6027\u8868<br \/>\nTrial page\u5141\u8bb8\u4f60\u6d4f\u89c8TIRAL\u72b6\u6001\u5e76\u8f93\u5165\u6ce8\u518c\u7801\uff08\u5982\u679c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u6ca1\u6709\u6ce8\u518c\uff09<br \/>\nSettings page<br \/>\n\u8fd9\u9875\u5305\u542b\u5bf9\u4e0b\u5217\u53c2\u6570\u7684\u7f16\u8f91\u6846<\/p>\n<p>Helper URL <br \/>\n\u8fd9\u4e2a\u53c2\u6570\u5f71\u54cd\u8fc7\u6ee4\u5668\u548c\u4ee3\u7406\u6a21\u5757\u4e4b\u95f4\u7684\u8054\u7cfb\u65b9\u5f0f\uff0c\u5b83\u5373\u53ef\u4ee5\u662f\u4ee5\u70b9\u505a\u524d\u7f00\u7684\u6587\u4ef6\u6269\u5c55\u540d\uff08\u5982 .isrwhlp\uff09\u4e5f\u53ef\u4ee5\u662f\u7edd\u5bf9\u8def\u5f84\uff0c<br \/>\n\u7b2c<br \/>\n\u4e00\u79cd\u60c5\u51b5\u4e0b\u6269\u5c55\u540d\u5c06\u8ffd\u52a0\u5728\u521d\u59cb\u8bf7\u6c42URI\u4e0a\u5e76\u4e14\u4ee3\u7406\u6a21\u5757\u7adf\u901a\u8fc7SCRIPT MAP\u6fc0\u6d3b\uff0c\u7f3a\u7701\u6269\u5c55\u540disrwhlp\u5728\u5b89\u88c5\u8fdb\u7a0b\u4e2d\u52a0\u5728global<br \/>\nscript map \u4e2d\uff0c\u5982\u679c\u4f60\u6539\u53d8\u8fd9\u4e2a\u6269\u5c55\u540d\u6216\u8005\u4f60\u7684\u5e94\u7528\u4e0d\u7ee7\u627fglobal script map \u8bbe\u7f6e\u4f60\u5e94\u8be5\u624b\u52a8\u6dfb\u52a0\u5411script map<br \/>\n\u6240\u9700\u6c42\u7684\u5165\u53e3\u3002\u8fd9\u4e2a\u5e94\u8be5\u6709\u5982\u4e0b\u53c2\u6570<br \/>\nExecutable: An absolute path to the rwhelper.dll in the short form <br \/>\nExtension: Desired extension (.isrwhlp is default) <br \/>\nVerbs radio button: All Verbs <br \/>\nScript engine checkbox: Checked <br \/>\nCheck that file exists checkbox: Unchecked <br \/>\n\u6211\u4eec\u5df2\u7ecf\u521b\u5efa\u4e86\u4e00\u4e2aWSH script proxycfg.vbs \uff0c\u53ef\u4ee5\u7b80\u5355\u5728\u4e00\u4e2aa script maps\u4e2d\u6ce8\u518c\uff0c\u5979\u4f4d\u4e8e\u5b89\u88c5\u6587\u4ef6\u5939\u5e76\u4e14\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e00\u5982\u4e0b\u65b9\u5f0f\u8fd0\u884c<br \/>\ncscript proxycfg.vbs [-r] [MetabasePath] <br \/>\nOptional -r \u5f3a\u5236\u6ce8\u518c\u6269\u5c55\u540d<br \/>\nOptional MetabasePath parameter allows specification of the first metabase key to process. By default it is \"\/localhost\/W3SVC\".<br \/>\n\u8981\u5728\u6240\u6709\u73b0\u5b58\u7684 script maps \u4e2d\u6ce8\u518c\u4f60\u53ef\u4ee5\u4ee5\u5982\u4e0b\u547d\u4ee4\u884c\u6fc0\u6d3b script <br \/>\ncscript proxycfg.vbs -r <br \/>\n\u7b2c\u4e8c\u79cd\u60c5\u51b5\u4e0b\u4f60\u5e94\u8be5\u63d0\u4f9b\u4e00\u4e2aURI\u4f5c\u4e3a'Helper URL'\u7684\u503c\uff0c\u4f60\u4e5f\u5e94\u8be5map \u4e00\u4e2a ISAPI_Rewrite\u7684\u5b89\u88c5\u6587\u4ef6\u5939\u4f5c\u4e3a\u7f8e\u610f\u4e2a\u7ad9\u70b9\u7684\u865a\u62df\u6587\u4ef6\u5bb6<br \/>\n\u6ce8\u610f\uff1a\u6839\u636e\u987e\u5ba2\u53cd\u5e94\uff0cIIS5\uff08\u4e5f\u8bb8\u5305\u62ecIIS4\uff09\u5bf9\u957f\u76ee\u5f55\u540d\u6709\u95ee\u9898\u3002\u6240\u4ee5\u6211\u4eec\u5f3a\u70c8\u63a8\u8350\u4f7f\u7528\u77ed\u76ee\u5f55\u540d<br \/>\nWorker threads limit <br \/>\n\u8fd9\u4e2a\u53c2\u6570\u9650\u5236\u5728\u4ee3\u7406\u6269\u5c55\u7ebf\u7a0b\u6c60\u4e2d\u5de5\u4f5c\u7ebf\u7a0b\u6570\uff0c\u7f3a\u7701\u4e3a0\u610f\u5473\u7740\u8fd9\u4e2a\u9650\u5236\u7b49\u4e8e\u5904\u7406\u5668\u6570\u91cf\u4e58\u4ee52<br \/>\nActive threads limit<br \/>\n\u8fd9\u4e2a\u53c2\u6570\u9650\u5236\u5f53\u524d\u8fd0\u884c\u7ebf\u7a0b\u6570\uff0c\u8fd9\u4e2a\u6570\u91cf\u4e0d\u53ef\u5927\u4e8e\"Worker threads limit\". \u7f3a\u77010\u610f\u601d\u662f\u7b49\u4e8e\u5904\u7406\u5668\u6570\u91cf<br \/>\nQueue size \u8fd9\u4e2a\u53c2\u6570\u5b9a\u4e49\u6700\u5927\u8bf7\u6c42\u6570\u91cf\uff0c\u5982\u679c\u4f60\u66fe\u7ecf\u770b\u5230Queue timeout expired\" \u4fe1\u606f\u5728 the Application event log\u4e2d\u4f60\u53ef\u4ee5\u589e\u52a0\u8fd9\u4e2a\u53c2\u6570<br \/>\nQueue timeout <br \/>\n\u8fd9\u4e2a\u53c2\u6570\u5b9a\u4e49\u4f60\u5728\u5185\u90e8\u8bf7\u6c42\u961f\u5217\u4e2d\u9632\u6b62\u65b0\u8bf7\u6c42\u7684\u6700\u5927\u7b49\u5f85\u65f6\u95f4\uff0c\u5982\u679c\u4f60\u66fe\u7ecf\u770b\u5230Queue timeout expired\" \u4fe1\u606f\u5728 the Application event log\u4e2d\u4f60\u53ef\u4ee5\u589e\u52a0\u8fd9\u4e2a\u53c2\u6570<br \/>\nConnect timeout <br \/>\n\u4ee5\u6beb\u79d2\u8bbe\u5b9a\u4ee3\u7406\u6a21\u5757\u8fde\u63a5\u8d85\u65f6<br \/>\nSend timeout <br \/>\n\u4ee5\u6beb\u79d2\u8bbe\u5b9a\u4ee3\u7406\u6a21\u5757\u53d1\u9001\u8d85\u65f6<br \/>\nReceive timeout <br \/>\n\u4ee5\u6beb\u79d2\u8bbe\u5b9a\u4ee3\u7406\u6a21\u5757\u53d1\u9001\u8d85\u65f6<br \/>\nAbout page. <br \/>\nIt contains copyright information and a link to the ISAPI_Rewrite's web site.<\/p>\n<p>Regular e\u00adxpression syntax<br \/>\n\u8fd9\u4e00\u90e8\u5206\u8986\u76d6\u4e86 ISAPI_Rewrite\u89c4\u5b9a\u7684\u8868\u8fbe\u53e5\u6cd5<br \/>\nLiterals<br \/>\n\u6240\u6709\u5b57\u7b26\u90fd\u662f\u539f\u610f\u9664\u4e86 \".\", \"*\", \"?\", \"+\", \"(\", \")\", \"{\", \"}\", \"[\", \"]\", \"^\" and \"$\".\uff0c\u8fd9\u4e9b\u5b57\u7b26\u5728\u7528\u201c\u201d\u5904\u7406\u65f6\u662f\u539f\u610f\uff0c\u539f\u610f\u6307\u4e00\u4e2a\u5b57\u7b26\u5339\u914d\u81ea\u8eab<br \/>\nWildcard<br \/>\nThe dot character \".\" matches any single character except null character and newline character<br \/>\n\u4ee5\u4e0b\u4e3a\u53e5\u6cd5<br \/>\nRepeats<br \/>\nA<br \/>\n repeat is an e\u00adxpression that is repeated an arbitrary number of times.<br \/>\n An e\u00adxpression followed by \"*\" can be repeated any number of times<br \/>\nincluding zero. An e\u00adxpression followed by \"+\" can be repeated any<br \/>\nnumber of times, but at least once. An e\u00adxpression followed by \"?\" may<br \/>\nbe repeated zero or one times only. When it is necessary to specify the<br \/>\nminimum and maximum number of repeats explicitly, the bounds operator<br \/>\n\"{}\" may be used, thus \"a{2}\" is the letter \"a\" repeated exactly twice,<br \/>\n\"a{2,4}\" represents the letter \"a\" repeated between 2 and 4 times, and<br \/>\n\"a{2,}\" represents the letter \"a\" repeated at least twice with no upper<br \/>\nlimit. Note that there must be no white-space inside the {}, and there<br \/>\nis no upper limit on the values of the lower and upper bounds. All<br \/>\nrepeat e\u00adxpressions refer to the shortest possible previous<br \/>\nsub-e\u00adxpression: a single character; a character set, or a<br \/>\nsub-e\u00adxpression grouped with \"()\" for example.<\/p>\n<p>Examples:<\/p>\n<p>\"ba*\" will match all of \"b\", \"ba\", \"baaa\" etc. <br \/>\n\"ba+\" will match \"ba\" or \"baaaa\" for example but not \"b\". <br \/>\n\"ba?\" will match \"b\" or \"ba\". <br \/>\n\"ba{2,4}\" will match \"baa\", \"baaa\" and \"baaaa\". <br \/>\nNon-greedy repeats<br \/>\nNon-greedy<br \/>\n repeats are possible by appending a '?' after the repeat; a non-greedy<br \/>\nrepeat is one which will match the shortest possible string.<\/p>\n<p>For example to match html tag pairs one could use something like:<\/p>\n<p>\"&lt;s*tagname[^&gt;]*&gt;(.*?)&lt;s*\/tagnames*&gt;\"<\/p>\n<p>In this case $1 will contain the text between the tag pairs, and will be the shortest possible matching string. <\/p>\n<p>Parenthesis<br \/>\nParentheses<br \/>\n serve two purposes, to group items together into a sub-e\u00adxpression, and<br \/>\n to mark what generated the match. For example the e\u00adxpression \"(ab)*\"<br \/>\nwould match all of the string \"ababab\". All sub matches marked by<br \/>\nparenthesis can be back referenced using N or $N syntax. It is<br \/>\npermissible for sub-e\u00adxpressions to match null strings. Sub-e\u00adxpressions<br \/>\n are indexed from left to right starting from 1, sub-e\u00adxpression 0 is<br \/>\nthe whole e\u00adxpression.<\/p>\n<p>Non-Marking Parenthesis<br \/>\nSometimes you<br \/>\nneed to group sub-e\u00adxpressions with parenthesis, but don't want the<br \/>\nparenthesis to spit out another marked sub-e\u00adxpression, in this case a<br \/>\nnon-marking parenthesis (?:e\u00adxpression) can be used. For example the<br \/>\nfollowing e\u00adxpression creates no sub-e\u00adxpressions:<\/p>\n<p>\"(?:abc)*\" <\/p>\n<p>Alternatives<br \/>\nAlternatives<br \/>\n occur when the e\u00adxpression can match either one sub-e\u00adxpression or<br \/>\nanother, each alternative is separated by a \"|\". Each alternative is the<br \/>\n largest possible previous sub-e\u00adxpression; this is the opposite<br \/>\nbehaviour from repetition operators.<\/p>\n<p>Examples:<\/p>\n<p>\"a(b|c)\" could match \"ab\" or \"ac\". <br \/>\n\"abc|def\" could match \"abc\" or \"def\". <br \/>\nSets<br \/>\nA<br \/>\n set is a set of characters that can match any single character that is a<br \/>\n member of the set. Sets are delimited by \"[\" and \"]\" and can contain<br \/>\nliterals, character ranges, character classes, collating elements and<br \/>\nequivalence classes. Set declarations that start with \"^\" contain the<br \/>\ncompliment of the elements that follow.<\/p>\n<p>Examples:<\/p>\n<p>Character literals:<\/p>\n<p>\"[abc]\" will match either of \"a\", \"b\", or \"c\". <br \/>\n\"[^abc] will match any character other than \"a\", \"b\", or \"c\". <br \/>\nCharacter ranges:<\/p>\n<p>\"[a-z]\" will match any character in the range \"a\" to \"z\". <br \/>\n\"[^A-Z]\" will match any character other than those in the range \"A\" to \"Z\". <br \/>\nCharacter classes<br \/>\nCharacter<br \/>\n classes are denoted using the syntax \"[:classname:]\" within a set<br \/>\ndeclaration, for example \"[[:space:]]\" is the set of all whitespace<br \/>\ncharacters. The available character classes are: <\/p>\n<p>alnum Any alpha numeric character. <br \/>\nalpha Any alphabetical character a-z and A-Z. Other characters may also be included depending upon the locale. <br \/>\nblank Any blank character, either a space or a tab. <br \/>\ncntrl Any control character. <br \/>\ndigit Any digit 0-9. <br \/>\ngraph Any graphical character. <br \/>\nlower Any lower case character a-z. Other characters may also be included depending upon the locale. <br \/>\nprint Any printable character. <br \/>\npunct Any punctuation character. <br \/>\nspace Any whitespace character. <br \/>\nupper Any upper case character A-Z. Other characters may also be included depending upon the locale. <br \/>\nxdigit Any hexadecimal digit character, 0-9, a-f and A-F. <br \/>\nword Any word character - all alphanumeric characters plus the underscore. <br \/>\nunicode Any character whose code is greater than 255, this applies to the wide character traits classes only. <\/p>\n<p>There are some shortcuts that can be used in place of the character classes:<\/p>\n<p>w in place of [:word:] <br \/>\ns in place of [:space:] <br \/>\nd in place of [:digit:] <br \/>\nl in place of [:lower:] <br \/>\nu in place of [:upper:] <br \/>\nCollating elements<br \/>\nCollating<br \/>\n elements take the general form [.tagname.] inside a set declaration,<br \/>\nwhere tagname is either a single character, or a name of a collating<br \/>\nelement, for example [[.a.]] is equivalent to [a], and [[.comma.]] is<br \/>\nequivalent to [,]. ISAPI_Rewrite supports all the standard POSIX<br \/>\ncollating element names, and in addition the following digraphs: \"ae\",<br \/>\n\"ch\", \"ll\", \"ss\", \"nj\", \"dz\", \"lj\", each in lower, upper and title case<br \/>\nvariations. Multi-character collating elements can result in the set<br \/>\nmatching more than one character, for example [[.ae.]] would match two<br \/>\ncharacters, but note that [^[.ae.]] would only match one character. <\/p>\n<p>Equivalence classes<br \/>\nEquivalenceclassestakethegeneralform[=tagname=]<br \/>\n inside a set declaration, where tagname is either a single character,<br \/>\nor a name of a collating element, and matches any character that is a<br \/>\nmember of the same primary equivalence class as the collating element<br \/>\n[.tagname.]. An equivalence class is a set of characters that collate<br \/>\nthe same, a primary equivalence class is a set of characters whose<br \/>\nprimary sort key are all the same (for example strings are typically<br \/>\ncollated by character, then by accent, and then by case; the primary<br \/>\nsort key then relates to the character, the secondary to the<br \/>\naccentation, and the tertiary to the case). If there is no equivalence<br \/>\nclass corresponding to tagname, then [=tagname=] is exactly the same as<br \/>\n[.tagname.].<\/p>\n<p>To include a literal \"-\" in a set declaration then:<br \/>\nmake it the first character after the opening \"[\" or \"[^\", the endpoint<br \/>\nof a range, a collating element, or precede it with an escape character<br \/>\nas in \"[-]\". To include a literal \"[\" or \"]\" or \"^\" in a set then make<br \/>\nthem the endpoint of a range, a collating element, or precede with an<br \/>\nescape character. <\/p>\n<p>Line anchors<br \/>\nAn anchor is something that<br \/>\nmatches the null string at the start or end of a line: \"^\" matches the<br \/>\nnull string at the start of a line, \"$\" matches the null string at the<br \/>\nend of a line. <\/p>\n<p>Back references<br \/>\nA back reference is a<br \/>\nreference to a previous sub-e\u00adxpression that has already been matched,<br \/>\nthe reference is to what the sub-e\u00adxpression matched, not to the<br \/>\ne\u00adxpression itself. A back reference consists of the escape character \"\"<br \/>\n followed by a digit \"1\" to \"9\", \"1\" refers to the first<br \/>\nsub-e\u00adxpression, \"2\" to the second etc. For example the e\u00adxpression<br \/>\n\"(.*)1\" matches any string that is repeated about its mid-point for<br \/>\nexample \"abcabc\" or \"xyzxyz\". A back reference to a sub-e\u00adxpression that<br \/>\n did not participate in any match, matches the null string. In<br \/>\nISAPI_Rewrite all back references are global for entire RewriteRule and<br \/>\ncorresponding RewriteCond directives. Sub matches are numbered up to<br \/>\ndown and left to right beginning from the first RewriteCond directive of<br \/>\n the corresponding RewriteRule directive, if there is one.<\/p>\n<p>Forward Lookahead Asserts<br \/>\nThere are two forms of these; one for positive forward lookahead asserts, and one for negative lookahead asserts: <\/p>\n<p>\"(?=abc)\" matches zero characters only if they are followed by the e\u00adxpression \"abc\". <br \/>\n\"(?!abc)\" matches zero characters only if they are not followed by the e\u00adxpression \"abc\". <\/p>\n<p>Word operators<br \/>\nThe following operators are provided for compatibility with the GNU regular e\u00adxpression library.<\/p>\n<p>\"w\"<br \/>\n matches any single character that is a member of the \"word\" character<br \/>\nclass, this is identical to the e\u00adxpression \"[[:word:]]\". <br \/>\n\"W\"<br \/>\nmatches any single character that is not a member of the \"word\"<br \/>\ncharacter class, this is identical to the e\u00adxpression \"[^[:word:]]\". <br \/>\n\"&lt;\" matches the null string at the start of a word. <br \/>\n\"&gt;\" matches the null string at the end of the word. <br \/>\n\"\b\" matches the null string at either the start or the end of a word. <br \/>\n\"B\" matches a null string within a word. <br \/>\nEscape operator<br \/>\nThe escape character \"\" has several meanings.<\/p>\n<p>The escape operator may introduce an operator for example: back references, or a word operator. <br \/>\nThe<br \/>\n escape operator may make the following character normal, for example<br \/>\n\"*\" represents a literal \"*\" rather than the repeat operator. <br \/>\nSingle character escape sequences:<br \/>\nThe following escape sequences are aliases for single characters:<\/p>\n<p>Escape sequence Character code Meaning <br \/>\na 0x07 Bell character. <br \/>\n0x09 Tab character. <br \/>\nv 0x0B Vertical tab. <br \/>\ne 0x1B ASCII Escape character. <br \/>\ndd 0dd An octal character code, where dd is one or more octal digits. <br \/>\nxXX 0xXX A hexadecimal character code, where XX is one or more hexadecimal digits. <br \/>\nx{XX} 0xXX A hexadecimal character code, where XX is one or more hexadecimal digits, optionally a unicode character. <br \/>\ncZ z-@ An ASCII escape sequence control-Z, where Z is any ASCII character greater than or equal to the character code for '@'. <\/p>\n<p>Miscellaneous escape sequences:<br \/>\nThe<br \/>\n following are provided mostly for perl compatibility, but note that<br \/>\nthere are some differences in the meanings of l L u and U: <\/p>\n<p>Escape sequence Meaning <br \/>\nw Equivalent to [[:word:]]. <br \/>\nW Equivalent to [^[:word:]]. <br \/>\ns Equivalent to [[:space:]]. <br \/>\nS Equivalent to [^[:space:]]. <br \/>\nd Equivalent to [[:digit:]]. <br \/>\nD Equivalent to [^[:digit:]]. <br \/>\nl Equivalent to [[:lower:]]. <br \/>\nL Equivalent to [^[:lower:]]. <br \/>\nu Equivalent to [[:upper:]]. <br \/>\nU Equivalent to [^[:upper:]]. <br \/>\nC Any single character, equivalent to '.'. <br \/>\nX Match any Unicode combining character sequence, for example \"ax 0301\" (a letter a with an acute). <br \/>\nQ The begin quote operator, everything that follows is treated as a literal character until a E end quote operator is found. <br \/>\nE The end quote operator, terminates a sequence begun with Q. <br \/>\nWhat gets matched?<br \/>\nThe<br \/>\n regular e\u00adxpression will match the first possible matching string, if<br \/>\nmore than one string starting at a given location can match then it<br \/>\nmatches the longest possible string. In cases where their are multiple<br \/>\npossible matches all starting at the same location, and all of the same<br \/>\nlength, then the match chosen is the one with the longest first<br \/>\nsub-e\u00adxpression, if that is the same for two or more matches, then the<br \/>\nsecond sub-e\u00adxpression will be examined and so on. Note that<br \/>\nISAPI_Rewrite uses MATCH algorithm. The result is matched only if the<br \/>\ne\u00adxpression matches the whole input sequence. For example: <\/p>\n<p>RewriteCond URL ^\/somedir\/.* #will match any request to somedir directory and subdirectories, while <br \/>\nRewriteCond URL ^\/somedir\/ #will match only request to the root of the somedir. <br \/>\nSpecial note about \"pathological\" regular e\u00adxpressions<br \/>\nISAPI_Rewrite<br \/>\n uses a very powerful regular e\u00adxpressions engine Regex++ written by Dr.<br \/>\n John Maddock. But as any real thing it's not ideal: There exists some<br \/>\n\"pathological\" e\u00adxpressions which may require exponential time for<br \/>\nmatching; these all involve nested repetition operators, for example<br \/>\nattempting to match the e\u00adxpression \"(a*a)*b\" against N letter a's<br \/>\nrequires time proportional to 2N. These e\u00adxpressions can (almost) always<br \/>\n be rewritten in such a way as to avoid the problem, for example<br \/>\n\"(a*a)*b\" could be rewritten as \"a*b\" which requires only time linearly<br \/>\nproportional to N to solve. In the general case, non-nested repeat<br \/>\ne\u00adxpressions require time proportional to N2, however if the clauses are<br \/>\n mutually exclusive then they can be matched in linear time - this is<br \/>\nthe case with \"a*b\", for each character the matcher will either match an<br \/>\n \"a\" or a \"b\" or fail, where as with \"a*a\" the matcher can't tell which<br \/>\nbranch to take (the first \"a\" or the second) and so has to try both.<\/p>\n<p>Boost<br \/>\n 1.29.0 Regex++ could detect \"pathological\" regular e\u00adxpressions and<br \/>\nterminate theirs matching. When a rule fails ISAPI_Rewrite sends \"500<br \/>\nInternal Server error - Rule Failed\" status to a client to indicate<br \/>\nconfiguration error. Also the failed rule is disabled to prevent<br \/>\nperformance losses<br \/>\nFormat string syntax<br \/>\nIn format strings, all characters are treated as literals except: \"(\", \")\", \"$\", \"\", \"?\", \":\".<\/p>\n<p>To use any of these as literals you must prefix them with the escape character <\/p>\n<p>The following special sequences are recognized: <\/p>\n<p>Grouping:<br \/>\nUse<br \/>\n the parenthesis characters ( and ) to group sub-e\u00adxpressions within the<br \/>\n format string, use ( and ) to represent literal '(' and ')'. <\/p>\n<p>Sub-e\u00adxpression expansions:<br \/>\nThe following perl like e\u00adxpressions expand to a particular matched sub-e\u00adxpression:<\/p>\n<p>$`<br \/>\n Expands to all the text from the end of the previous match to the start<br \/>\n of the current match, if there was no previous match in the current<br \/>\noperation, then everything from the start of the input string to the<br \/>\nstart of the match. <br \/>\n$' Expands to all the text from the end of the match to the end of the input string. <br \/>\n$&amp; Expands to all of the current match. <br \/>\n$0 Expands to all of the current match. <br \/>\n$N Expands to the text that matched sub-e\u00adxpression N. <\/p>\n<p>Conditional e\u00adxpressions:<br \/>\nConditional<br \/>\n e\u00adxpressions allow two different format strings to be selected<br \/>\ndependent upon whether a sub-e\u00adxpression participated in the match or<br \/>\nnot:<\/p>\n<p>?Ntrue_e\u00adxpression:false_e\u00adxpression<\/p>\n<p>Executes true_e\u00adxpression if sub-e\u00adxpression N participated in the match, otherwise executes false_e\u00adxpression.<\/p>\n<p>Example:<br \/>\n suppose we search for \"(while)|(for)\" then the format string<br \/>\n\"?1WHILE:FOR\" would output what matched, but in upper case.<\/p>\n<p>Escape sequences:<br \/>\nThe following escape sequences are also allowed:<\/p>\n<p>\na The bell character. <br \/>\nf The form feed character. <\/p>\n<p>The newline character. <br \/>\nThe carriage return character. <br \/>\nThe tab character. <br \/>\nv A vertical tab character. <br \/>\nx A hexadecimal character - for example x0D. <br \/>\nx{} A possible unicode hexadecimal character - for example x{1A0} <br \/>\ncx The ASCII escape character x, for example c@ is equivalent to escape-@. <br \/>\ne The ASCII escape character. <br \/>\ndd An octal character constant, for example 10 <br \/>\nExamples\u4f8b\u5b50<br \/>\nEmulating host-header-based virtual sites on a single site<br \/>\n\u4f8b\u5982\u4f60\u5728\u4e24\u4e2a\u57df\u540d\u6ce8\u518cwww.site1.com \u548c www.site2.com\uff0c\u73b0\u5728\u4f60\u53ef\u4ee5\u521b\u5efa\u4e24\u4e2a\u4e0d\u540c\u7684\u7ad9\u70b9\u800c\u4f7f\u7528\u5355\u4e00\u7684\u7269\u7406\u7ad9\u70b9\u3002\u628a\u4ee5\u4e0b\u89c4\u5219\u52a0\u5165\u5230\u4f60\u7684httpd.ini \u6587\u4ef6<br \/>\n[ISAPI_Rewrite]<\/p>\n<p>#Fix missing slash char on folders<br \/>\nRewriteCond Host: (.*)<br \/>\nRewriteRule ([^.?]+[^.?\/]) http:\/\/$1$2\/ [I,R]<\/p>\n<p>#Emulate site1<br \/>\nRewriteCond Host: (?:www.)?site1.com<br \/>\nRewriteRule (.*) \/site1$1 [I,L]<\/p>\n<p>#Emulate site2<br \/>\nRewriteCond Host: (?:www.)?site2.com<br \/>\nRewriteRule (.*) \/site2$1 [I,L]<\/p>\n<p>\n\u73b0\u5728\u4f60\u53ef\u4ee5\u628a\u4f60\u7684\u7ad9\u70b9\u653e\u5728\/site1 \u548c \/site2 \u76ee\u5f55\u4e2d.<\/p>\n<p>\u6216\u8005\u4f60\u53ef\u4ee5\u5e94\u7528\u66f4\u591a\u7684\u7c7b\u89c4\u5219\uff1a<br \/>\n[ISAPI_Rewrite]<\/p>\n<p>#Fix missing slash char on folders<br \/>\nRewriteCond Host: (.*)<br \/>\nRewriteRule ([^.?]+[^.?\/]) http:\/\/$1$2\/ [I,R]<\/p>\n<p>RewriteCond Host: (www.)?(.+)<br \/>\nRewriteRule (.*) \/$2$3<br \/>\n\u4e3a\u7ad9\u70b9\u5e94\u8be5\u547d\u540d\u76ee\u5f55\u4e3a \/somesite1.com, \/somesite2.info, etc.<br \/>\nUsing loops (Next flag) to convert request parameters<br \/>\n\u5047\u5982\u4f60\u5e0c\u671b\u6709\u7269\u7406URL\u5982 http:\/\/www.myhost.com\/foo.asp?a=A&amp;b=B&amp;c=C \u4f7f\u7528\u8bf7\u6c42\u5982 http:\/\/www.myhost.com\/foo.asp\/a\/A\/b\/B\/c\/C \u53c2\u6570\u6570\u91cf\u53ef\u4ee5\u4ece\u4e24\u4e2a\u8bf7\u6c42\u4e4b\u95f4\u53d8\u5316<\/p>\n<p>\u81f3\u5c11\u6709\u4e24\u4e2a\u89e3\u51b3\u529e\u6cd5\u3002\u4f60\u53ef\u4ee5\u7b80\u5355\u7684\u4e3a\u6bcf\u4e00\u53ef\u80fd\u7684\u53c2\u6570\u6570\u91cf\u6dfb\u52a0\u4e00\u4e2a\u5206\u9694\u89c4\u5219\u6216\u8005\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u6280\u672f\u8bf4\u660e\u5982\u4e0b\u9762\u7684\u4f8b\u5b50<br \/>\nISAPI_Rewrite]<br \/>\nRewriteRule (.*?.asp)(?[^\/]*)?\/([^\/]*)\/([^\/]*)(.*) $1(?2$2&amp;:?)$3=$4$5 [NS,I]<br \/>\n\u8fd9\u4e2a\u89c4\u5219\u5c06\u4ece\u8bf7\u6c42\u7684URL\u4e2d\u62bd\u53d6\u4e00\u4e2a\u53c2\u6570\u8ffd\u52a0\u5728\u8bf7\u6c42\u5b57\u7b26\u7684\u672b\u5c3e\u5e76\u4e14\u4ece\u5934\u91cd\u542f\u89c4\u5219\u8fdb\u7a0b\u3002\u6240\u4ee5\u5b83\u5c06\u5faa\u73af\u76f4\u5230\u6240\u6709\u53c2\u6570\u88ab\u79fb\u52a8\u5230\u9002\u5f53\u7684\u4f4d\u7f6e\uff0c\u6216\u8005\u76f4\u5230\u8d85\u8fc7RepeatLimit<br \/>\n\u4e5f\u5b58\u5728\u8bb8\u591a\u8fd9\u4e2a\u89c4\u5219\u7684\u53d8\u79cd\u3002\u4f46\u4f7f\u7528\u4e0d\u540c\u7684\u5206\u9694\u5b57\u7b26\uff0c\u4f8b\u5982\u3002\u4f7f\u7528URLS\u5982http:\/\/www.myhost.com\/foo.asp~a~A~b~B~c~C \u53ef\u4ee5\u5e94\u4e2d\u4e0b\u9762\u7684\u89c4\u5219\uff1a<br \/>\nISAPI_Rewrite]<br \/>\nRewriteRule (.*?.asp)(?[^~]*)?~([^~]*)~([^~]*)(.*) $1(?2$2&amp;:?)$3=$4$5 [NS,I]<br \/>\nRunning servers behind IIS<br \/>\n\u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u5185\u7f51\u670d\u52a1\u5668\u8fd0\u884cIIS\u800c\u51e0\u4e2a\u516c\u53f8\u670d\u52a1\u5668\u8fd0\u884c\u5176\u4ed6\u5e73\u53f0\uff0c\u8fd9\u4e9b\u670d\u52a1\u5668\u4e0d\u80fd\u4eceINTERNET\u76f4\u63a5\u8fdb\u5165\uff0c\u800c\u53ea\u80fd\u4ece\u6211\u4eec\u516c\u53f8\u7684\u7f51\u7edc\u8fdb\u5165\uff0c\u6709\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u53ef\u4ee5\u4f7f\u7528\u4ee3\u7406\u6807\u8bb0\u6620\u5c04\u5176\u4ed6\u670d\u52a1\u5668\u5230IIS\u547d\u540d\u7a7a\u95f4\uff1a<br \/>\n[ISAPI_Rewrite]<br \/>\nRewriteProxy \/mappoint(.+) http:\/\/sitedomain$1 [I,U]<br \/>\nMoving sites from UNIX to IIS<br \/>\n\u8fd9\u4e2a\u89c4\u5219\u53ef\u4ee5\u5e2e\u52a9\u4f60\u628aURL\u4ece \/~username \u6539\u53d8\u5230 \/username \u548c\u4ece \/file.html \u6539\u53d8\u5230 \/file.htm. \u8fd9\u4e2a\u5728\u4f60\u4ec5\u4ec5\u628a\u4f60\u7684\u7ad9\u4eceUNIX\u79fb\u52a8\u5230IIS\u5e76\u4e14\u4fdd\u6301\u641c\u7d22\u5f15\u64ce\u548c\u5176\u4ed6\u5916\u90e8\u9875\u9762\u5bf9\u8001\u9875\u9762\u7684\u8fde\u63a5\u65f6\u662f\u6709\u7528\u7684<br \/>\n[ISAPI_Rewrite]<\/p>\n<p>#redirecting to update old links<br \/>\nRewriteRule (.*).html $1.htm<br \/>\nRewriteRule \/~(.*) http:\/\/myserver\/$1 [R]<br \/>\nMoving site location<br \/>\n\u8bb8\u591a\u7f51\u7ba1\u95ee\u8fd9\u6837\u7684\u95ee\u9898\uff1a\u4ed6\u4eec\u8981\u91cd\u5b9a\u5411\u6240\u6709\u7684\u8bf7\u6c42\u5230\u4e00\u4e2a\u65b0\u7684\u7f51\u7edc\u670d\u52a1\u5668\uff0c\u5f53\u4f60\u9700\u8981\u5efa\u7acb\u4e00\u4e2a\u66f4\u65b0\u7684\u7ad9\u70b9\u53d6\u4ee3\u8001\u7684\u7684\u65f6\u5019\u7ecf\u5e38\u51fa\u73b0\u8fd9\u6837\u7684\u95ee\u9898\uff0c\u89e3\u51b3\u65b9\u6848\u662f\u7528ISAPI_Rewrite \u4e8e\u8001\u670d\u52a1\u5668\u4e2d<br \/>\n[ISAPI_Rewrite]<\/p>\n<p>#redirecting to update old links<br \/>\nRewriteRule (.+) http:\/\/newwebserver$1 [R]<\/p>\n<p>Browser-dependent content<br \/>\nDynamically generated robots.txt<br \/>\nrobots.txt\u662f\u4e00\u4e2a\u641c\u7d22\u5f15\u64ce\u7528\u6765\u53d1\u73b0\u80fd\u4e0d\u80fd\u88ab\u7d22\u5f15\u7684\u6587\u4ef6\uff0c\u4f46\u662f\u4e3a\u4e00\u4e2a\u5927\u7ad9\u521b\u5efa\u4e00\u4e2a\u6709\u8bb8\u591a\u52a8\u6001\u5185\u5bb9\u7684\u8fd9\u4e2a\u6587\u4ef6\u662f\u5f88\u590d\u6742\u7684\u5de5\u4f5c\uff0c\u6211\u4eec\u53ef\u4ee5\u5199\u4e00\u4e2arobots.asp script<\/p>\n<p>\u73b0\u5728\u4f7f\u7528\u5355\u4e00\u89c4\u5219\u751f\u6210 robots.txt <br \/>\n[ISAPI_Rewrite]<\/p>\n<p>RewriteRule \/robots.txt \/robots.asp<br \/>\nMaking search engines to index dynamic pages<br \/>\n\u7ad9\u70b9\u7684\u5185\u5bb9\u5b58\u50a8\u5728XML\u6587\u4ef6\u4e2d\uff0c\u5728\u670d\u52a1\u5668\u4e0a\u6709\u4e00\u4e2a\/XMLProcess.asp \u6587\u4ef6\u5904\u7406XML\u6587\u4ef6\u5e76\u8fd4\u56deHTML\u5230\u6700\u7ec8\u7528\u6237\uff0cURLS\u5230\u6587\u6863\u6709\u5982\u4e0b\u5f62\u5f0f<br \/>\nhttp:\/\/www.mysite.com\/XMLProcess.asp?xml=\/somdir\/somedoc.xml<br \/>\n\u4f46\u662f\u8bb8\u591a\u516c\u5171\u5f15\u64ce\u4e0d\u80fd\u7d22\u5f15\u6b64\u7c7b\u6587\u6863\uff0c\u56e0\u4e3aURLS\u5305\u542b\u95ee\u53f7\uff08\u6587\u6863\u52a8\u6001\u751f\u6210\uff09\uff0c<br \/>\nISAPI_Rewrite\u53ef\u4ee5\u5b8c\u5168\u6d88\u9664\u8fd9\u4e2a\u95ee\u9898<br \/>\n[ISAPI_Rewrite]<\/p>\n<p>RewriteRule \/doc(.*).htm \/XMLProcess.asp?xml=$1.xml<br \/>\n\u73b0\u5728\u4f7f\u7528\u5982\u540chttp:\/\/www.mysite.com\/doc\/somedir\/somedoc.htm\u7684URL\u8fdb\u5165\u6587\u6863\uff0c\u641c\u7d22\u5f15\u64ce\u5c06\u4e0d\u77e5\u9053\u4e0d\u662fsomedoc.htm \u6587\u4ef6\u5e76\u4e14\u5185\u5bb9\u662f\u52a8\u6001\u751f\u6210\u7684<br \/>\nNegative e\u00adxpressions (NOT<br \/>\n\u6709\u65f6\u5f53\u6a21\u5f0f\u4e0d\u5339\u914d\u4f60\u9700\u8981\u5e94\u7528\u89c4\u5219\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\u4f60\u53ef\u4ee5\u4f7f\u7528\u5728\u89c4\u5219\u8868\u8fbe\u5f0f\u4e2d\u79f0\u4e3aForward Lookahead Asserts <br \/>\n\u4f8b\u5982\u4f60\u9700\u8981\u4e0d\u4f7f\u7528IE\u628a\u6240\u6709\u7528\u6237\u79fb\u52a8\u5230\u522b\u7684\u5730\u70b9<br \/>\n[ISAPI_Rewrite]<br \/>\n# Redirect all non Internet Explorer users<br \/>\n# to another location<br \/>\nRewriteCond User-Agent: (?!.*MSIE).*<br \/>\nRewriteRule (.*) \/nonie$1<br \/>\nDynamic authentification<br \/>\n\u4f8b\u5982\u6211\u4eec\u5728\u7ad9\u70b9\u4e0a\u6709\u4e00\u4e9b\u6210\u5458\u57df\uff0c\u6211\u4eec\u5728\u8fd9\u4e2a\u57df\u4e0a\u9700\u8981\u5bc6\u7801\u4fdd\u62a4\u6587\u4ef6\u800c\u6211\u4eec\u4e0d\u559c\u6b22\u7528BUILT-IN\u670d\u52a1\u5668\u5b89\u5168\uff0c\u8fd9\u4e2a\u60c5\u51b5\u4e0b\u53ef\u4ee5\u5efa\u7acb\u4e00\u4e2aASP\u811a\u672c\uff08\u79f0\u4e3aproxy.asp\uff09\uff0c\u8fd9\u4e2a\u811a\u672c\u5c06\u4ee3\u7406\u6240\u6709\u8bf7\u6c42\u5230\u6210\u5458\u57df\u5e76\u4e14\u68c0\u67e5\u8bf7\u6c42\u5141\u8bb8\uff0c\u8fd9\u91cc\u6709\u4e00\u4e2a\u7b80\u5355\u7684\u6a21\u677f\u4f60\u53ef\u4ee5\u653e\u8fdb\u4f60\u81ea\u5df1\u7684\u6388\u6743\u4ee3\u7801<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u8981\u901a\u8fc7\u914d\u7f6e ISAPI_Rewrite \u901a\u8fc7\u8fd9\u4e2a\u9875\u9762\u4ee3\u7406\u8bf7\u6c42:<\/p>\n<p>[ISAPI_Rewrite]<br \/>\n# Proxy all requests through proxy.asp<br \/>\nRewriteRule \/members(.+) \/proxy.asp?http:\/\/mysite.com\/members$1<br \/>\nBlocking inline-images (stop hot linking<\/p>\n<p>\u5047\u8bbe\u6211\u4eec\u5728http:\/\/www.mysite.com\/\u4e0b\u6709\u4e9b\u9875\u9762\u6709\u4e00\u4e9b\u5185\u8054 GIF\u56fe\u7247\u5f88\u597d\uff0c\u4ed6\u4eba\u53ef\u4ee5\u4e0d\u76f4\u63a5\u534f\u5546\u901a\u8fc7\u76d7\u94fe\u5230\u4ed6\u4eec\u7684\u9875\u9762\u4e0a\uff0c\u6211\u4eec\u4e0d\u559c\u6b22\u8fd9\u6837\u56e0\u4e3a\u52a0\u5927\u4e86\u670d\u52a1\u5668\u6d41\u91cf<br \/>\n\u5f53\u6211\u4eec\u4e0d\u80fd100%\u4fdd\u62a4\u56fe\u7247\uff0c\u6211\u4eec\u81f3\u5c11\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u53d1\u9001\u4e00\u4e2aHTTP Referer header\u7684\u5730\u65b9\u9650\u5236\u8fd9\u79cd\u60c5\u51b5<br \/>\n[ISAPI_Rewrite]<br \/>\nRewriteCond Host: (.+)<br \/>\nRewriteCond Referer: (?!http:\/\/1.*).*<br \/>\nRewriteRule .*.(?:gif|jpg|png) \/block.gif [I,O]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u7f6e\uff1a<br \/>\n\u5728NT 2000<br \/>\nXP\u548c2003\u5e73\u53f0\u4e0a\uff0c\u5728\u7cfb\u7edf\u5e10\u6237\u4e0b\u5e94\u8be5INETINFO\u7a0b\u5e8f\u5e94\u8be5\u4e0eIIS5\u4ee5\u5171\u5b58\u6a21\u5f0f\u8fc7\u6ee4\u5668\u8fd0\u884c\u3002\u6240\u4ee5\u7cfb\u7edf\u5e10\u6237\u5e94\u8be5\u7ed9\u4e88\u5bf9\u6240\u6709\u7684ISAPI-<br \/>\nREWIRITE DLLS<br \/>\n\u548c\u6240\u6709\u7684HTTPD\u3002INI\u6587\u4ef6\u81f3\u5c11\u53ef\u8bfb\u6743\u9650\uff0c\u6211\u4eec\u4e5f\u63a8\u8350\u5bf9\u7ed9\u4e88\u7cfb\u7edf\u5e10\u6237\u5bf9\u4e8e\u6240\u6709\u5305\u62ecHTTPD\u3002INI\u6587\u4ef6\u7684\u6587\u4ef6\u5939\u7684\u53ef\u5199\u6743\u9650\uff0c\u8fd9\u5c06\u5141\u8bb8\u4ea7\u751fHTTP\u3002<br \/>\nPARSE\u3002ERRORS\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5305\u542b\u914d\u7f6e\u6587\u4ef6\u8bed\u6cd5\u9519\u8bef\u3002\u5bf9\u4e8ePROXY\u6a21\u5757\u4e5f\u9700\u8981\u989d\u5916\u7684\u6743\u9650\uff0c\u56e0\u4e3a\u5b83\u5c06\u8fd0\u884c\u4e8e\u8fde\u63a5\u6c60\u6216HIGH-ISPLATED<br \/>\n\u5e94\u7528\u6a21\u5f0f\uff0cIIS\u5e10\u6237\u5171\u4eab\u6c60\u548cHIGH-ISOLATION\u6c60\u5e94\u88ab\u7ed9\u4e88<br \/>\n\u5bf9RWHELPERE\u3002DLL\u7684... <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/201\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[273],"tags":[],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-article"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=201"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}