{"id":34251,"date":"2024-11-25T15:14:08","date_gmt":"2024-11-25T07:14:08","guid":{"rendered":"https:\/\/fwq.ai\/blog\/34251\/"},"modified":"2024-11-25T15:14:08","modified_gmt":"2024-11-25T07:14:08","slug":"phpcms%e6%89%8b%e6%9c%ba%e7%ab%af%e5%a6%82%e4%bd%95%e5%8f%96%e6%b6%88%e4%bc%aa%e9%9d%99%e6%80%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/34251\/","title":{"rendered":"phpcms\u624b\u673a\u7aef\u5982\u4f55\u53d6\u6d88\u4f2a\u9759\u6001"},"content":{"rendered":"<blockquote><p>\n  \u82e5\u9700\u53d6\u6d88 phpcms \u624b\u673a\u7aef\u4f2a\u9759\u6001\uff1a\u6ce8\u91ca\u6389 include\/extend.func.php \u4e2d\u7684 import_right()\uff1b\u4fee\u6539 include\/mobile.config.php \u4e2d\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u5141\u8bb8 url \u5305\u542b\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u548c\u8fde\u5b57\u7b26\uff1b\u6e05\u9664 statics\/mobile\/ \u76ee\u5f55\u4e0b\u7684\u4f2a\u9759\u6001\u6587\u4ef6\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/21\/2024042100033747836.jpg\" class=\"aligncenter\" title=\"phpcms\u624b\u673a\u7aef\u5982\u4f55\u53d6\u6d88\u4f2a\u9759\u6001\u63d2\u56fe\" alt=\"phpcms\u624b\u673a\u7aef\u5982\u4f55\u53d6\u6d88\u4f2a\u9759\u6001\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u53d6\u6d88 PHPCMS \u624b\u673a\u7aef\u4f2a\u9759\u6001<\/strong><\/p>\n<p><strong>\u76f4\u63a5\u53d6\u6d88<\/strong><\/p>\n<p>\u5728 include\/extend.func.php \u6587\u4ef6\u4e2d\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>if(defined('IS_MOBILE') &amp;&amp; defined('URLRULE') &amp;&amp; URLRULE == 'html') {\n    import_right();\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06\u5176\u6ce8\u91ca\u6389\u6216\u5220\u9664\u5373\u53ef\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>\u4fee\u6539\u4f2a\u9759\u6001\u89c4\u5219<\/strong><\/p>\n<p>\u5728 include\/mobile.config.php \u6587\u4ef6\u4e2d\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>if (defined('IS_MOBILE') &amp;&amp; $_SERVER['REQUEST_URI'] != '\/index.php') {\n    $matches = array();\n    preg_match('\/\/(.*?)\/([0-9]+)\/$\/i', URL, $matches);\n    if (count($matches) == 3) {\n        $_GET['catid'] = $matches[2];\n    }\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06 \/([0-9]+)\/$\/i \u4e2d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u4fee\u6539\u4e3a \/([0-9a-zA-Z-_]+)\/$\/i\uff0c\u5373\u53ef\u5141\u8bb8\u4f2a\u9759\u6001 URL \u5305\u542b\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u548c\u8fde\u5b57\u7b26\u3002<\/p>\n<p><strong>\u6e05\u9664\u4f2a\u9759\u6001\u6587\u4ef6<\/strong><\/p>\n<p>\u5982\u679c\u4e4b\u524d\u751f\u6210\u4e86\u4f2a\u9759\u6001\u6587\u4ef6\uff0c\u9700\u8981\u6e05\u9664\u8fd9\u4e9b\u6587\u4ef6\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u8fdb\u884c\uff1a<\/p>\n<ul>\n<li>\u624b\u52a8\u5220\u9664\uff1a\u627e\u5230 statics\/mobile\/ \u76ee\u5f55\u4e0b\u7684\u6240\u6709 .html \u6587\u4ef6\u5e76\u5220\u9664\u3002<\/li>\n<li>\u8fd0\u884c\u547d\u4ee4\uff1arm -rf statics\/mobile\/*.html<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u624b\u673a\u7aef\u5982\u4f55\u53d6\u6d88\u4f2a\u9759\u6001\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u82e5\u9700\u53d6\u6d88 phpcms \u624b\u673a\u7aef\u4f2a\u9759\u6001\uff1a\u6ce8\u91ca\u6389 include\/extend.func.php \u4e2d\u7684 import_right()\uff1b\u4fee\u6539 include\/mobile.config.php \u4e2d\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u5141\u8bb8 url \u5305\u542b\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u548c\u8fde\u5b57\u7b26\uff1b\u6e05\u9664 statics\/mobile\/ \u76ee\u5f55\u4e0b\u7684\u4f2a\u9759\u6001\u6587\u4ef6\u3002 \u5982\u4f55\u53d6\u6d88 PHPCMS \u624b\u673a\u7aef\u4f2a\u9759\u6001 \u76f4\u63a5\u53d6\u6d88 \u5728 include\/extend.func.php \u6587\u4ef6\u4e2d\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\uff1a if(defined(&#8216;IS_MOBILE&#8217;) &amp;&amp; defined(&#8216;URLRULE&#8217;) &amp;&amp; URLRULE == &#8216;html&#8217;) { import_right(); } \u767b\u5f55\u540e\u590d\u5236 \u5c06\u5176\u6ce8\u91ca\u6389\u6216\u5220\u9664\u5373\u53ef\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u4fee\u6539\u4f2a\u9759\u6001\u89c4\u5219 \u5728 include\/mobile.config.php \u6587\u4ef6\u4e2d\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\uff1a if (defined(&#8216;IS_MOBILE&#8217;) &amp;&amp; $_SERVER[&#8216;REQUEST_URI&#8217;] != &#8216;\/index.php&#8217;) { $matches = array(); preg_match(&#8216;\/\/(.*?)\/([0-9]+)\/$\/i&#8217;, URL, $matches); if (count($matches) == 3) { $_GET[&#8216;catid&#8217;] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-34251","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/34251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=34251"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/34251\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=34251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=34251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=34251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}