{"id":49376,"date":"2024-10-08T04:18:27","date_gmt":"2024-10-07T20:18:27","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49376\/"},"modified":"2024-10-08T04:18:27","modified_gmt":"2024-10-07T20:18:27","slug":"url-%e9%87%8d%e5%af%ab-iirf%ef%bc%88ionics-isapi-rewrite-filter%ef%bc%89%e6%89%8b%e5%86%8a%e7%ac%ac-1-2-%e9%a0%81","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49376\/","title":{"rendered":"URL \u91cd\u5beb IIRF\uff08Ionic&#8217;s Isapi Rewrite Filter\uff09\u624b\u518a\u7b2c 1\/2 \u9801"},"content":{"rendered":"<h1 id=\"url-%e9%87%8d%e5%af%ab-iirf%ef%bc%88ionics-isapi-rewrite-filter%ef%bc%89%e6%89%8b%e5%86%8a%e7%ac%ac-1-2-%e9%a0%81-ijGIQsWJVt\">URL \u91cd\u5beb IIRF\uff08Ionic&#8217;s Isapi Rewrite Filter\uff09\u624b\u518a\u7b2c 1\/2 \u9801<\/h1>\n<p>\u5728\u73fe\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0cURL \u91cd\u5beb\u6280\u8853\u5df2\u6210\u70ba\u7db2\u7ad9\u512a\u5316\u548c\u7528\u6236\u9ad4\u9a57\u63d0\u5347\u7684\u91cd\u8981\u5de5\u5177\u3002Ionic&#8217;s Isapi Rewrite Filter\uff08\u7c21\u7a31 IIRF\uff09\u662f\u4e00\u6b3e\u529f\u80fd\u5f37\u5927\u7684 URL \u91cd\u5beb\u5de5\u5177\uff0c\u5c08\u70ba Microsoft IIS\uff08Internet Information Services\uff09\u4f3a\u670d\u5668\u8a2d\u8a08\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e IIRF \u7684\u57fa\u672c\u6982\u5ff5\u3001\u5b89\u88dd\u6b65\u9a5f\u53ca\u5176\u914d\u7f6e\u65b9\u6cd5\uff0c\u5e6b\u52a9\u7528\u6236\u66f4\u597d\u5730\u7406\u89e3\u548c\u61c9\u7528\u9019\u4e00\u6280\u8853\u3002<\/p>\n<h2 id=\"iirf-%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%a6%82%e5%bf%b5-ijGIQsWJVt\">IIRF \u7684\u57fa\u672c\u6982\u5ff5<\/h2>\n<p>IIRF \u662f\u4e00\u500b\u8f15\u91cf\u7d1a\u7684 ISAPI \u6ffe\u93e1\uff0c\u80fd\u5920\u5728 IIS \u4f3a\u670d\u5668\u4e0a\u5be6\u73fe URL \u91cd\u5beb\u529f\u80fd\u3002\u5b83\u7684\u4e3b\u8981\u4f5c\u7528\u662f\u5c07\u7528\u6236\u8acb\u6c42\u7684 URL \u8f49\u63db\u70ba\u66f4\u53cb\u597d\u7684\u683c\u5f0f\uff0c\u9019\u4e0d\u50c5\u6709\u52a9\u65bc SEO\uff08\u641c\u7d22\u5f15\u64ce\u512a\u5316\uff09\uff0c\u9084\u80fd\u63d0\u5347\u7528\u6236\u7684\u53ef\u8b80\u6027\u548c\u53ef\u8a2a\u554f\u6027\u3002\u4f8b\u5982\uff0c\u5c07\u4e00\u500b\u8907\u96dc\u7684\u67e5\u8a62\u5b57\u7b26\u4e32\u8f49\u63db\u70ba\u7c21\u55ae\u7684\u8def\u5f91\u5f62\u5f0f\uff1a<\/p>\n<pre><code>\u539f\u59cb URL: http:\/\/example.com\/product.php?id=123\n\u91cd\u5beb\u5f8c\u7684 URL: http:\/\/example.com\/product\/123<\/code><\/pre>\n<h2 id=\"iirf-%e7%9a%84%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-ijGIQsWJVt\">IIRF \u7684\u5b89\u88dd\u6b65\u9a5f<\/h2>\n<p>\u5b89\u88dd IIRF \u7684\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\uff0c\u4ee5\u4e0b\u662f\u5177\u9ad4\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f09 IIRF \u7684\u6700\u65b0\u7248\u672c\uff0c\u901a\u5e38\u53ef\u4ee5\u5728\u5176\u5b98\u65b9\u7db2\u7ad9\u627e\u5230\u3002<\/li>\n<li>\u5c07\u4e0b\u8f09\u7684\u6a94\u6848\u89e3\u58d3\u7e2e\uff0c\u4e26\u5c07 <code>IIRF.dll<\/code> \u6a94\u6848\u8907\u88fd\u5230 IIS \u7684 <code>inetsrv<\/code> \u76ee\u9304\u4e2d\u3002<\/li>\n<li>\u6253\u958b IIS \u7ba1\u7406\u5668\uff0c\u9078\u64c7\u9700\u8981\u914d\u7f6e\u7684\u7db2\u7ad9\uff0c\u7136\u5f8c\u5728\u53f3\u5074\u7684\u529f\u80fd\u9762\u677f\u4e2d\u9078\u64c7\u300cISAPI \u548c CGI \u9650\u5236\u300d\u3002<\/li>\n<li>\u9ede\u64ca\u300c\u6dfb\u52a0\u300d\uff0c\u7136\u5f8c\u9078\u64c7\u525b\u525b\u8907\u88fd\u7684 <code>IIRF.dll<\/code> \u6a94\u6848\uff0c\u4e26\u5141\u8a31\u5176\u57f7\u884c\u3002<\/li>\n<li>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5728\u7db2\u7ad9\u7684\u6839\u76ee\u9304\u4e2d\u5275\u5efa\u4e00\u500b\u540d\u70ba <code>IIRF.ini<\/code> \u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u9019\u500b\u6587\u4ef6\u5c07\u7528\u65bc\u5b9a\u7fa9 URL \u91cd\u5beb\u898f\u5247\u3002<\/li>\n<\/ol>\n<h2 id=\"iirf-%e7%9a%84%e9%85%8d%e7%bd%ae%e6%96%b9%e6%b3%95-ijGIQsWJVt\">IIRF \u7684\u914d\u7f6e\u65b9\u6cd5<\/h2>\n<p>\u5728 <code>IIRF.ini<\/code> \u6587\u4ef6\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5b9a\u7fa9\u591a\u7a2e\u91cd\u5beb\u898f\u5247\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u57fa\u672c\u7684\u914d\u7f6e\u7bc4\u4f8b\uff1a<\/p>\n<pre><code>[Rewrite]\n# \u5c07 \/product\/123 \u91cd\u5beb\u70ba \/product.php?id=123\nRewriteRule ^\/product\/([0-9]+)$ \/product.php?id=$1 [I]<\/code><\/pre>\n<p>\u5728\u9019\u500b\u4f8b\u5b50\u4e2d\uff0c\u7576\u7528\u6236\u8a2a\u554f <code>\/product\/123<\/code> \u6642\uff0cIIRF \u5c07\u81ea\u52d5\u5c07\u8acb\u6c42\u91cd\u5beb\u70ba <code>\/product.php?id=123<\/code>\u3002\u9019\u6a23\u7684\u91cd\u5beb\u4e0d\u50c5\u4f7f URL \u66f4\u52a0\u7c21\u6f54\uff0c\u9084\u6709\u52a9\u65bc\u63d0\u9ad8\u7db2\u7ad9\u7684 SEO \u8868\u73fe\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e7%9a%84%e9%85%8d%e7%bd%ae%e9%81%b8%e9%a0%85-ijGIQsWJVt\">\u5e38\u898b\u7684\u914d\u7f6e\u9078\u9805<\/h2>\n<p>IIRF \u63d0\u4f9b\u4e86\u591a\u7a2e\u914d\u7f6e\u9078\u9805\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u9078\u9805\uff1a<\/p>\n<ul>\n<li><code>LogLevel<\/code>: \u8a2d\u5b9a\u65e5\u8a8c\u7684\u8a73\u7d30\u7a0b\u5ea6\uff0c\u4fbf\u65bc\u6392\u67e5\u554f\u984c\u3002<\/li>\n<li><code>RewriteLog<\/code>: \u6307\u5b9a\u65e5\u8a8c\u6587\u4ef6\u7684\u8def\u5f91\u3002<\/li>\n<li><code>AllowEncodedSlashes<\/code>: \u662f\u5426\u5141\u8a31\u7de8\u78bc\u7684\u659c\u6760\u3002<\/li>\n<\/ul>\n<p>\u9019\u4e9b\u9078\u9805\u53ef\u4ee5\u6839\u64da\u5be6\u969b\u9700\u6c42\u9032\u884c\u8abf\u6574\uff0c\u4ee5\u9054\u5230\u6700\u4f73\u7684\u91cd\u5beb\u6548\u679c\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-ijGIQsWJVt\">\u7e3d\u7d50<\/h2>\n<p>IIRF \u662f\u4e00\u6b3e\u5f37\u5927\u7684 URL \u91cd\u5beb\u5de5\u5177\uff0c\u80fd\u5920\u5e6b\u52a9\u7db2\u7ad9\u7ba1\u7406\u54e1\u512a\u5316\u7db2\u7ad9\u7d50\u69cb\uff0c\u63d0\u9ad8\u7528\u6236\u9ad4\u9a57\u548c\u641c\u7d22\u5f15\u64ce\u6392\u540d\u3002\u901a\u904e\u7c21\u55ae\u7684\u5b89\u88dd\u548c\u914d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u5be6\u73fe URL \u91cd\u5beb\u529f\u80fd\uff0c\u8b93\u60a8\u7684\u7db2\u7ad9\u66f4\u52a0\u53cb\u597d\u548c\u6613\u65bc\u8a2a\u554f\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u7528\u6236\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22 IIRF\uff08Ionic&#8217;s Isapi Rewrite Filter\uff09\u624b\u518a\u7b2c 1\/2 \u9801\uff0c\u4e86\u89e3\u5982\u4f55\u6709\u6548\u9032\u884c URL \u91cd\u5beb\uff0c\u63d0\u5347\u7db2\u7ad9\u6027\u80fd\u8207 SEO\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-49376","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=49376"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49376\/revisions"}],"predecessor-version":[{"id":49377,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49376\/revisions\/49377"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}