{"id":48,"date":"2012-05-18T19:32:27","date_gmt":"2012-05-18T11:32:27","guid":{"rendered":"http:\/\/www.datarelab.com\/blog\/?p=48"},"modified":"2012-05-18T19:32:27","modified_gmt":"2012-05-18T11:32:27","slug":"httpd.ini%20%e4%bc%aa%e9%9d%99%e6%80%81%e8%ae%be%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/48.html","title":{"rendered":"httpd.ini \u4f2a\u9759\u6001\u8bbe\u7f6e"},"content":{"rendered":"<p>\u4ec0\u4e48\u662f\u7f51\u9875\u7684\u4f2a\u9759\u6001\u6280\u672f?<\/p>\n<p>\u4f7f\u7528ISAPI Rewrite\u4e0eApache Rewrite\u662f\u6709\u533a\u522b\u7684\uff0c\u4e3b\u8981\u662fURL\u91cd\u5199\u89c4\u5219\u7ec6\u8282\u4e0a\uff0cISAPI[\u4e00\u822c\u662fwindows\u7cfb\u7edf]\u91cd\u5199\u9700\u8981\u4f7f\u7528httpd.ini\u6587\u4ef6\uff0c\u800cApache[\u4e00\u822c\u662funix\u7cfb\u7edf]\u5219\u4f7f\u7528.htaccess\u6587\u4ef6\uff0c\u901a\u8fc7\u5bf9URL\u91cd\u5199\u5b9e\u4f8b\u8c08\u8c08\u4f7f\u7528httpd.ini\u6587\u4ef6\u57fa\u4e8eISAPI Rewrite\u91cd\u5199URL\u8def\u5f84\u3002\u76ee\u524d\u4f7f\u7528\u7684\u662fwordpress\u7a0b\u5e8f\uff0c\u867d\u7136\u524d\u53f0\u5df2\u7ecf\u5168\u90e8\u91cd\u65b0\u67b6\u6784\uff0c\u4f46URL\u8def\u5f84\u8fd8\u662f\u4f7f\u7528\u539f\u6709\u7b80\u5355\u7684URL\uff0c\u5982\u4e00\u7bc7\u6587\u7ae0\u7684URL\u8def\u5f84\uff1ahttp:\/\/www.adminjet.com\/?p=1119\uff0c\u5206\u7c7b\u4f7f\u7528?cat=162\u7b49\u3002<\/p>\n<p>\u672c\u6587\u4ee5httpd.ini\u91cd\u5199\u6587\u7ae0URL\u8def\u5f84\u4e3a\u4f8b\uff0c\u5176\u5b83URL\u91cd\u5199\u539f\u7406\u4e00\u6837\u3002<\/p>\n<p>\u91cd\u5199\u524dURL\u8def\u5f84\uff1a<a href=\"http:\/\/www.adminjet.com\/p1119.html\">http:\/\/www.adminjet.com\/p1119.html<\/a>[\u8fd9\u662f\u9700\u8981\u5b9e\u73b0\u7684URL\u5730\u5740]<br \/>\n\u91cd\u5199\u540eURL\u8def\u5f84\uff1a<a href=\"http:\/\/www.adminjet.com\/?p=1119\">http:\/\/www.adminjet.com\/?p=1119<\/a>[\u8fd9\u4e5f\u662f\u5f53\u524d\u7684URL\u5730\u5740]<\/p>\n<p><strong>\u4e00\uff0c\u65b0\u5efahttpd.ini\u6587\u4ef6<\/strong><\/p>\n<p><strong>\u4e8c\uff0c\u6253\u5f00httpd.ini\u6587\u4ef6\u5e76\u589e\u52a0\u5982\u4e0b\u91cd\u5199\u89c4\u5219<\/strong><\/p>\n<ol>\n<li>[ISAPI_Rewrite]<\/li>\n<li>RewriteRule ^\/p([0-9]+)\\.html \/index\\.php\\?p=$1 [L]<\/li>\n<\/ol>\n<p>\u6ce8\u610f\u5176\u4e2d\u7684\u4e00\u4e9b\u7ec6\u8282\uff0c\u53cd\u659c\u6760\\\u90e8\u5206\uff0c\u8fd9\u4e2a\u975e\u5e38\u91cd\u8981[\u6216\u8bb8\u4f60\u4f1a\u6f0f\u6389\u8fd9\u53e5\u8bdd\uff0c\u4f46\u5982\u679c\u4f60\u770b\u5230\u4e86\u5c06\u4f1a\u7701\u5f88\u591a\u7684\u8c03\u8bd5\u65f6\u95f4]\uff0c\u5bf9\u4e8e\u7279\u6b8a\u5b57\u7b26\u8981\u4f7f\u7528\u53cd\u659c\u6760\\\u3002<\/p>\n<ol>\n<li>RewriteRule ^\/p([0-9]+)\\.html \/index\\.php\\?p=$1 [L]<\/li>\n<\/ol>\n<p>\u5176\u89c4\u5219\u4e3a\u5339\u914d\u4f7f\u6709p\u5f00\u5934\u7684\u5b57\u7b26\uff0c\u5176\u4e2d\u53c2\u6570\u90e8\u5206$1\u53ea\u80fd\u662f\u6570\u5b57[0-9]\uff0c\u5e76\u4ee5.html\u7ed3\u675f\uff0c\u5982p1119.html\uff0c\u5c31\u4f1a\u5339\u914d\u4e3aindex.php?p=1119\uff0c\u8fd9\u6837\u7a0b\u5e8f\u5c31\u80fd\u6b63\u5e38\u7684\u8bfb\u53d6ID\u4e3a1119\u7684\u6587\u7ae0\u3002<\/p>\n<p><strong>\u4e09\uff0c\u4e0a\u4f20\u5230\u4f60\u7a7a\u95f4\u7684\u6839\u76ee\u5f55<\/strong><\/p>\n<p><strong>\u56db\uff0c\u5f00\u59cb\u8c03\u8bd5\uff0c\u8c03\u8bd5\u8fc7\u7a0b\u53ef\u591a\u5237\u65b0\u9875\u9762<\/strong><\/p>\n<p>\u540c\u6837\u7684URL\u91cd\u5199\uff0c\u5982\u679c\u662f\u5728apache\u4e0b\u7684.htaccess\u5219\u4f7f\u7528\u5982\u4e0b\u8bed\u53e5\uff1a<\/p>\n<ol>\n<li>RewriteEngine on<\/li>\n<li>RewriteRule ^p([0-9]*).html$ index.php?p=$1 [L]<\/li>\n<\/ol>\n<p>\u73b0\u5728\u6765\u5bf9\u6bd4\u8fd9\u4e24\u8005\u7684\u533a\u522b\uff1a<\/p>\n<ol>\n<li>ISAPI Rewrite\uff1a<\/li>\n<li><span style=\"font-size:medium;\"><span style=\"font-size:small;\">RewriteRule ^\/p([0-9]+)\\.html \/index\\.php\\?p=$1 [L]<\/span><\/span><\/li>\n<\/ol>\n<ol>\n<li>Apache Rewrite:<\/li>\n<li><span style=\"font-size:medium;\"><span style=\"font-size:small;\">RewriteRule ^p([0-9]*).html$ index.php?p=$1 [L]<\/span><\/span><\/li>\n<\/ol>\n<p>\u533a\u522b\u5c31\u662f\u4e00\u4e9b\u53cd\u659c\u6760\uff0c\u8fd9\u5bf9\u4e8e\u8c03\u8bd5\u975e\u5e38\u91cd\u8981\uff0c\u5176\u5b83\u5177\u4f53\u7684\u77e5\u8bc6\u5927\u5bb6\u53ef\u53c2\u8003\u76f8\u5e94\u7684\u6587\u6863\uff0c\u7b80\u5355\u5b9e\u73b0\u4f60\u7684ISAPI Rewrite\u91cd\u5199URL\u8def\u5f84\u3002<\/p>\n<p>ASP\u7f51\u7ad9\u7a0b\u5e8f\u5728\u56fd\u5185\u8fd0\u7528\u5f88\u5e7f,\u4f46\u662f\u7c7b\u4f3c\u4e8eim286.asp?id=20050307213811\u8fd9\u6837\u7684URL\u6709\u70b9\u4e0d\u5229\u4e8e\u641c\u7d22\u5f15\u64ce\u7684\u6536\u5f55,\u4e5f\u5c31\u662f\u8bf4\u4e0d\u7b26\u5408\u53cb\u597dURL(URLs-Friendly)\u7684\u6807\u51c6,\u90a3\u4e48\u6211\u4eec\u7528ISAPI_Rewrite\u6253\u9020\u4e00\u4e2aClean URL,<\/p>\n<p>1.\u4e0b\u8f7dISAPI_Rewrite.ISAPI_Rewrite\u5206\u7cbe\u7b80(Lite)\u548c\u5b8c\u5168(Full)\u7248.\u7cbe\u7b80\u7248\u4e0d\u652f\u6301\u5bf9\u6bcf\u4e2a\u865a\u62df\u4e3b\u673a\u7ad9\u70b9\u8fdb\u884c\u91cd\u5199,\u53ea\u80fd\u8fdb\u884c\u5168\u5c40\u5904\u7406.\u4e0d\u8fc7\u5bf9\u4e8e\u6709\u670d\u52a1\u5668\u7684\u670b\u53cb,\u7cbe\u7b80\u7248\u4e5f\u5c31\u591f\u5566.\u7cbe\u7b80\u7248\u4e0b\u8f7d\u5730\u5740:http:\/\/www.helicontech.com \/download\/,\u5c31\u662f\u90a3Lite Version (free)\u5566.<\/p>\n<p>2.\u5b89\u88c5.msi\u7684\u6587\u4ef6,\u548c\u88c5\u4e00\u822c\u7a0b\u5e8f\u4e00\u6837\u88c5\u5c31\u53ef\u4ee5\u4e86,\u4ffa\u5c31\u88c5\u5728D:\\ISAPI_Rewrite.<\/p>\n<p><img decoding=\"async\" title=\"\" alt=\"\" src=\"https:\/\/www.datarelab.com\/blog\/content\/uploadfile\/201205\/2413f093d42d40c6d46245b12b90f0af20120518113443.jpg\" \/><\/p>\n<p>3.\u63a5\u4e0b\u6765\u4e00\u6b65\u6bd4\u8f83\u91cd\u8981\u54e6,\u770b\u4ed4\u7ec6\u55bd.\u6253\u5f00Internet \u4fe1\u606f\u670d\u52a1,\u53f3\u952e,web\u7ad9\u70b9\u5c5e\u6027,\u7535ISAPI\u7b5b\u9009\u5668\u9009\u9879\u5361.\u6dfb\u52a0\u7b5b\u9009\u5668,\u540d\u79f0\u81ea\u5df1\u586b,\u8def\u5f84\u81ea\u5df1\u6307\u5b9aISAPI_Rewrite.dll,\u7136\u540e\u786e\u5b9a.<\/p>\n<p><img decoding=\"async\" style=\"width:540px;cursor:pointer;\" title=\"\" alt=\"\" src=\"https:\/\/www.datarelab.com\/blog\/content\/uploadfile\/201205\/489e60dc704dde919de72883bd04919720120518113443.jpg\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>4.\u6765\u6d4b\u8bd5\u4e00\u4e0b.\u65b0\u5efa\u4e00\u4e2a1ting.asp,\u91cc\u9762\u5199\u4e0a<\/p>\n<p>&nbsp;&nbsp; &lt;%=request.querystring(\"inso\")%&gt; <br \/>\n&nbsp;<\/p>\n<p>,\u6548\u679c\u5c31\u662f\u6267\u884c\u7684\u65f6\u50191ting.asp?inso=*\u6d4f\u89c8\u5668\u663e\u793a*.<\/p>\n<p><img decoding=\"async\" title=\"\" alt=\"\" src=\"https:\/\/www.datarelab.com\/blog\/content\/uploadfile\/201205\/70d0a8b6476497860992e0bcc8cc173e20120518113443.jpg\" \/><\/p>\n<p>5.\u8fd9\u4e00\u6b65\u5f88\u91cd\u8981\u54e6,\u5f00\u59cb\u6dfb\u52a0rewrite\u89c4\u5219.\u6b63\u5219,\u597d\u5934\u75db,\u5e78\u4e8f\u8fd9\u4e2a\u4f8b\u5b50\u6bd4\u8f83\u7b80\u5355.<br \/>\n\u627e\u5230ISAPI_Rewrite\u76ee\u5f55,\u628ahttpd.ini\u7684\u53ea\u8bfb\u5c5e\u6027\u53bb\u6389,\u6253\u5f00\u7f16\u8f91.\u6211\u4eec\u8981\u628a1ting.asp?inso=im286\u6620\u5c04\u6210\u4e3a1ting-im286.html\u8fd9\u6837\u7684\u7c7b\u578b,\u9700\u8981\u5728httpd.ini\u91cc\u52a0\u4e0a\u8fd9\u4e48\u4e00\u884c:<br \/>\n&nbsp;&nbsp;&nbsp; <br \/>\nRewriteRule \/1ting-([0-9,a-z]*).html \/1ting.asp\\?inso=$1 <\/p>\n<p>,\u4fdd\u5b58.<\/p>\n<p><img decoding=\"async\" style=\"width:540px;cursor:pointer;\" title=\"\" alt=\"\" src=\"https:\/\/www.datarelab.com\/blog\/content\/uploadfile\/201205\/b780f9d4cee0baa8711476099c63bafb20120518113444.jpg\" \/><\/p>\n<p>6.\u6765\u6765\u6765,\u5230\u6d4f\u89c8\u5668\u91cc\u67e5\u770b\u4e00\u4e0b\u6548\u679c\u5427.\u8f93\u5165<a href=\"http:\/\/127.0.0.1\/1ting.asp?inso=im286\">http:\/\/127.0.0.1\/1ting.asp?inso=im286<\/a>\u548c<a href=\"http:\/\/127.0.0.1\/1ting-im286.html\">http:\/\/127.0.0.1\/1ting-im286.html<\/a>,\u663e\u793a\u7684\u5185\u5bb9\u662f\u4e0d\u662f\u90fd\u662fim286?\u8fd9\u5c31\u8bc1\u660e\u6210\u529f\u5566!<\/p>\n<p><img decoding=\"async\" title=\"\" alt=\"\" src=\"https:\/\/www.datarelab.com\/blog\/content\/uploadfile\/201205\/968b958d39b94980777c5a95b1b4d25720120518113444.jpg\" \/><\/p>\n<p>\u563f\u563f,1ting-im286.html\u8fd9\u6837\u7684\u9875\u9762\u8981\u6bd41ting.asp?inso=im286\u5bb9\u6613\u6536\u5165,\u6240\u4ee5\u73b0\u5728\u8fd8\u5728\u7528\u52a8\u6001\u65b9\u5f0f\u7684\u670b\u53cb\u53ef\u4ee5\u5c1d\u8bd5\u4e00\u4e0b\u8fd9\u6837\u7684\u9759\u6001\u6620\u5c04\u6548\u679c. IIS Rewrite\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u6837\u7684\u529f\u80fd\u3002<\/p>\n<p>------------------------------------------------------<\/p>\n<p>ASP\u4e4bURL\u91cd\u5199<\/p>\n<p>\u4e0b\u8f7dISAPI_Rewrite\u89e3\u538b\u5230\u4efb\u610f\u6587\u4ef6\u5939\u5b89\u88c5\uff0c\u7ed9IIS\u7528\u6237\u8bfb\u53d6\u6743\u9650\uff0c\u5728IIS\u53f3\u952e\u70b9\u51fb\u4e00\u4e2a\u7ad9\u70b9\uff0c\u5c5e\u6027\uff0cISAPI\u7b5b\u9009\u5668\uff0c\u6dfb\u52a0\uff0c\u7b5b\u9009\u5668\u540d\u79f0\u4e00\u5b9a\u5f97\u53eb re\uff0c\u53ef\u6267\u884c\u6587\u4ef6\u5c31\u70b9\u6d4f\u89c8\u627e\u5230\u4f60\u89e3\u538b\u7684\u76ee\u5f55Rewrite.dll\u52a0\u4e0a\u5373\u53ef\u3002<\/p>\n<p>\u3000\u3000\u91cd\u542f\uff29\uff29\uff33\u540e\u5e94\u8be5\u5c31\u80fd\u652f\u6301\uff35\uff32\uff2c\u91cd\u5199\u89c4\u5219\u4e86\u3002<\/p>\n<p>\u3000\u3000\u9700\u8981\u4fee\u6539\u89e3\u538b\u76ee\u5f55\u4e2d\u7684httpd.ini\u8fd9\u4e2a\u6587\u4ef6<\/p>\n<p>RewriteRule \/info_(\\d+)\\.htm \/info\\.asp\\?id=$1 [N,I]<\/p>\n<p>\u8fd9\u53e5\u8bdd\u5c31\u53ef\u4ee5\u628a\u63d0\u4ea4\u7684\u5730\u5740<a href=\"http:\/\/www.xxx.com\/info_122.htm\">http:\/\/www.xxx.com\/info_122.htm<\/a>\u6620\u5c04\u5230\u771f\u6b63\u7684\u5730\u5740 <a href=\"http:\/\/www.xxx.com\/info.asp?id=122\">http:\/\/www.xxx.com\/info.asp?id=122<\/a><\/p>\n<p>\u5982\u679c\u4f60\u5728\u5904\u7406\u6570\u636e\u7ffb\u9875\uff0c\u90a3\u4e48\u5199\u6cd5\u662f\uff1a<\/p>\n<p>More_&lt;%=Page%&gt;_&lt;%=type%&gt;.html \uff08\u6ce8\uff1apage\u662f\u7ffb\u9875\u9875\u6570\uff0ctype\u662f\u6570\u636e\u7c7b\u578b\uff09<br \/>\n\u8868\u73b0\u5f62\u5f0f\uff1aMore_1_95.html<\/p>\n<p>\u5982\u679c\u7ffb\u4e0b\u4e00\u9875\uff0c\u5219\u4e3a\uff1aMore_2_95.html\uff0c\u7ee7\u7eed\u4e0b\u4e00\u9875\u7684\u5faa\u73af\uff0c\u5219\u662f\uff1a<br \/>\nMore_3_95.html\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n<p>\u4e0d\u8fc7\u4f60\u9700\u8981\u5728httpd.ini\u6587\u4ef6\u4e2d\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<br \/>\nRewriteRule \/More_(\\d+)_(\\d+)\\.html \/jsp\/more\\.jsp\\?page=$1&amp;type=$2 [N,I]<\/p>\n<p>\u5982\u679c\u4f60\u7684\u52a8\u6001\u7a0b\u5e8f\u6709\u591a\u4e2a\u53c2\u6570\u9700\u8981\u4f20\u9012\uff0c\u90a3\u4e48\u5c31\u589e\u52a0\u591a\u4e2a(\\d+)\u5373\u53ef\uff0c\u5982\u4e0b\uff1a<\/p>\n<p>RewriteRule \/More_(\\d+)_(\\d+)_(\\d+)\\.html \/jsp\/more\\.jsp\\?page=$1&amp;type=$2&amp;type2=$3 [N,I]<\/p>\n<p>\u7ffb\u9875\u5904\u7406\u8868\u73b0\u5f62\u5f0f\u662f\uff1aMore_1_95.html<\/p>\n<p>\u5982\u679c\u60f3\u628a<a href=\"http:\/\/www.xxx.com\/info.asp?id=50#abc\">http:\/\/www.xxx.com\/info.asp?id=50#abc<\/a> \u8f6c\u6362\u6210\u9759\u6001\u7684\u7f51\u9875<br \/>\n\u56e0\u4e3a#abc\u662f\u7a0b\u5e8f\u5904\u7406\u4e86ID=50\u8fd9\u4e2a\u53d8\u91cf\u751f\u6210\u9759\u6001\u9875\u9762\u4e4b\u540e\u6309\u951a\u70b9\u53c8\u505a\u4e86\u4e00\u6b21\u9875\u5185\u94fe\u63a5\uff0c\u6240\u4ee5\u5e94\u8be5\u8fd9\u4e48\u505a\u6620\u5c04<br \/>\n<a href=\"http:\/\/www.xxx.com\/info.asp?id=50#abc\">http:\/\/www.xxx.com\/info.asp?id=50#abc<\/a>\u8f6c <span style=\"color:#f7fdfe;\">69<\/span><\/p>\n<p>\u6362\u6210<a href=\"http:\/\/www.xxx.com\/info_50.htm#abc\">http:\/\/www.xxx.com\/info_50.htm#abc<\/a>,\u91cd\u5199\u89c4\u5219\u5982\u4e0b\uff1a<br \/>\nRewriteRule \/info_(\\d+)\\.htm#(\\d+) \/info\\.asp\\?id=$1#$2 [N,I]<\/p>\n<p>\u6ce8\u610f\uff1a\u4ee5\u524d\u5728Window 2000 IIS5.0\u4e00\u76f4\u4f7f\u7528ISAPI_Rewrite\u8fdb\u884c\u52a8\u6001\u94fe\u63a5\u91cd\u5199HTML\u9759\u6001\u7f51\u5740\uff0c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662f\u7f51\u9875\u7684\u4f2a\u9759\u6001\u6280\u672f? \u4f7f\u7528ISAPI Rewrite\u4e0eApache Rewrite\u662f\u6709\u533a\u522b\u7684\uff0c\u4e3b\u8981\u662fURL [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[100,99],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-Technical_literature","tag-httpdini","tag-99"],"views":1695,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}