{"id":199199,"date":"2025-05-03T12:34:40","date_gmt":"2025-05-03T04:34:40","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199199\/"},"modified":"2025-05-03T12:34:40","modified_gmt":"2025-05-03T04:34:40","slug":"%e5%a6%82%e4%bd%95%e5%af%b9ecshop%e7%9a%84url%e8%b7%af%e5%be%84%e8%bf%9b%e8%a1%8c%e4%bc%98%e5%8c%96%e6%8a%8agoods%e4%bf%ae%e6%94%b9","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199199\/","title":{"rendered":"\u5982\u4f55\u5bf9ECShop\u7684url\u8def\u5f84\u8fdb\u884c\u4f18\u5316\u628agoods\u4fee\u6539"},"content":{"rendered":"<p>&nbsp;<span style=\"font-size: 14px;line-height: 25px\"><span>\u9996\u5148\u627e\u5230ecshop\u5e76\u6253\u5f00include\/lib_common.php\uff0c\u627e\u5230\u6587\u4ef6\u4e2d\u7684build_uri\u51fd\u6570\u3002\u627e\u5230\u4e0b\u9762\u8fd9\u6837\u7684\u4ee3\u7801\u3002<\/span><\/span><\/p>\n<blockquote style=\"font-family: Verdana, Arial, Tahoma;padding-top: 2px;padding-right: 5px;padding-bottom: 0px;padding-left: 40px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;background-attachment: initial;background-color: initial;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none;font-size: 13px;background-position: -99px 0px\">\n<p style=\"padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 24px;margin-left: 0px;background-image: initial;background-attachment: initial;background-color: transparent;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none\">case \u2018goods\u2019:<br \/> if (empty($gid))<br \/> {<br \/> return false;<br \/> }<br \/> else<br \/> {<br \/> $uri = $rewrite ? \u2018\u4f60\u9700\u8981\u7684\u5173\u952e\u8bcd\u62fc\u97f3-\u2019 . $gid : \u2018goods.php?id=\u2019 . $gid;<br \/> }<br \/> break;<\/p>\n<\/blockquote>\n<p style=\"font-family: Verdana, Arial, Tahoma;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 24px;margin-left: 0px;background-image: initial;background-attachment: initial;background-color: transparent;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none\"> \u63a5\u7740\uff0c\u6211\u4eec\u6253\u5f00.htaccess\u6587\u4ef6\u3002\u627e\u5230<\/p>\n<p style=\"font-family: Verdana, Arial, Tahoma;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 24px;margin-left: 0px;background-image: initial;background-attachment: initial;background-color: transparent;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none\"><code>RewriteRule ^goods-([0-9]+)(.*)\\.html$&nbsp; goods\\.php\\?id=$1 [QSA,L]<\/code><br \/> \u4fee\u6539\u6210\u4f60\u9700\u8981\u7684\u5185\u5bb9\uff0c\u5982\u4e0b<\/p>\n<p style=\"font-family: Verdana, Arial, Tahoma;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 24px;margin-left: 0px;background-image: initial;background-attachment: initial;background-color: transparent;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none\"><code>RewriteRule ^\u4f60\u9700\u8981\u7684\u5173\u952e\u8bcd\u62fc\u97f3-([0-9]+)(.*)\\.html$&nbsp; goods\\.php\\?id=$1 [QSA,L]<\/code><\/p>\n<p style=\"font-family: Verdana, Arial, Tahoma;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 24px;margin-left: 0px;background-image: initial;background-attachment: initial;background-color: transparent;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none\">\u6539\u5b8c\u4e4b\u540e\u518d\u8fdb\u5165ECShop\u540e\u53f0\u6e05\u9664\u7f13\u5b58\u5b8c\u6210\u4fee\u6539\u3002<\/p>\n<p style=\"font-family: Verdana, Arial, Tahoma;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 24px;margin-left: 0px;background-image: initial;background-attachment: initial;background-color: transparent;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none\">\u8fd9\u6837\uff0c\u4ee5\u540e\u90fd\u4e0d\u4f1a\u662fgoogs-1.html\u8fd9\u6837\u7684\u8def\u5f84\u4e86\u3002<\/p>\n<p style=\"font-family: Verdana, Arial, Tahoma;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 24px;margin-left: 0px;background-image: initial;background-attachment: initial;background-color: transparent;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none\">\u6700\u8fd1\u4e00\u76f4\u5728\u60f3\u5982\u4f55\u5bf9ECShop\u7684\u8def\u5f84\u8fdb\u884c\u66f4\u52a0\u4eba\u6027\u5316\u7684\u4f18\u5316\uff0c\u4e4b\u524d\u591a\u6b21\u5728\u5b98\u65b9\u793e\u533a\u63d0\u95ee\uff0c\u5e0c\u671b\u80fd\u51fa\u66f4\u52a0\u4f18\u5316\u7684ECShop\u91cd\u5199\u89c4\u5219\u3002\u867d\u7136ECShop\u6240\u6709\u7684\u6587\u4ef6\u90fd\u662f\u4e00\u7ea7\u8def\u5f84\uff0c\u5bf9\u4e8e\u5343\u7bc7\u4e00\u5f8b\u7684\u94fe\u63a5\uff0c\u5f88\u4e0d\u7406\u60f3\u3002\u5373\u4f7f\u6709\u7b80\u5355\u91cd\u5199\u548c\u590d\u6742\u91cd\u5199\uff0c\u4ecd\u7136\u4e0d\u80fd\u6ee1\u8db3\u8981\u6c42\u3002\u5982\u679c\u6bcf\u4e00\u4e2a\u5546\u54c1\u7684URL\u8def\u5f84\u80fd\u591f\u50cfwordpress\u535a\u5ba2\u4e00\u6837\uff0c\u81ea\u5df1\u5b9a\u4e49URL\uff0c\u90a3\u7b80\u76f4\u662f\u592a\u5b8c\u7f8e\u4e86\u3002\u53ef\u60dc\u5148\u9636\u6bb5\u662f\u65e0\u6cd5\u5b9e\u73b0\u4e86\u3002\u90a3\u4e48\u6211\u4eec\u8fd8\u662f\u53ef\u4ee5\u89c1\u5230\u7684\u8fdb\u884c\u4f18\u5316<\/p>\n<p style=\"font-family: Verdana, Arial, Tahoma;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 24px;margin-left: 0px;background-image: initial;background-attachment: initial;background-color: transparent;border-top-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-style: initial;border-color: initial;vertical-align: baseline;text-decoration: none\">\u597d\u6a21\u677f\u771f\u5e0c\u671b\u4ee5\u540e\u6709\u4e00\u5929\uff0cECShop\u7684\u9891\u9053\u680f\u76ee\u9875\u9762\u80fd\u591f\u66f4\u52a0\u5f3a\u5927\u4e00\u70b9\uff0cURL\u8def\u5f84\u4e5f\u66f4\u52a0\u4eba\u6027\u5316\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;\u9996\u5148\u627e\u5230ecshop&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-199199","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199199","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=199199"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199199\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}