{"id":31229,"date":"2024-11-25T11:17:31","date_gmt":"2024-11-25T03:17:31","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31229\/"},"modified":"2024-11-25T11:17:31","modified_gmt":"2024-11-25T03:17:31","slug":"phpcms%e5%85%a8%e7%ab%99%e4%bc%aa%e9%9d%99%e6%80%81%e8%ae%be%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31229\/","title":{"rendered":"phpcms\u5168\u7ad9\u4f2a\u9759\u6001\u8bbe\u7f6e"},"content":{"rendered":"<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/041\/5e3b8c04a065c719.jpg\" class=\"aligncenter\" title=\"phpcms\u5168\u7ad9\u4f2a\u9759\u6001\u8bbe\u7f6e\u63d2\u56fe\" alt=\"phpcms\u5168\u7ad9\u4f2a\u9759\u6001\u8bbe\u7f6e\u63d2\u56fe\" \/><\/p>\n<p>\u4e00\u3001\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u652f\u6301rewrite<\/p>\n<p>\u4f8b\u5982\u672c\u5730\u5f00\u542frewrite\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p>Apache \u914d\u7f6e\u6587\u4ef6 httpd.conf<\/p>\n<p>1\u3001<\/p>\n<pre>LoadModule&nbsp;rewrite_module&nbsp;modules\/mod_rewrite.so<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u628a\u8fd9\u53e5\u7684\u201c#\u201d\u6ce8\u91ca\u6389\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>2\u3001<\/p>\n<pre>AllowOverride&nbsp;none<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6539\u4e3a<\/p>\n<pre>AllowOverride&nbsp;all<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>3\u3001\u91cd\u542fapache\u670d\u52a1\u5668\u3002<\/p>\n<p>\u4e8c\u3001\u51c6\u5907.htaccess\u6587\u4ef6\uff08\u5982\u4f55\u5efa\u7acb. htaccess \uff09<\/p>\n<p>\u82e5\u662fwindows\uff0c\u53ef\u4ee5\u4f7f\u7528\u8bb0\u4e8b\u672c\uff0c\u4fdd\u5b58\u9009\u62e9\u53e6\u5b58\u4e3a\uff0c&#8221;.htaccess&#8221; \uff0c\u6ce8\u610f\u547d\u540d\u65f6\u8981\u52a0\u4e0a&#8221;&#8221;\uff0c\u5f97\u5230.htaccess\u6587\u4ef6\uff0c\u7136\u540e\u628a\u4ee5\u4e0b\u4ee3\u7801\u5199\u8fdb\u53bb\u4fdd\u5b58\u3002<\/p>\n<pre>RewriteEngine&nbsp;On\nRewriteRule&nbsp;^(.*)content-([0-9]+)-([0-9]+)-([0-9]+).html$&nbsp;$1\/index.php?m=content&amp;amp;c=index&amp;amp;a=show&amp;amp;catid=$2&amp;amp;id=&nbsp;\n$3&amp;amp;page=$4\nRewriteRule&nbsp;^(.*)show-([0-9]+)-([0-9]+)-([0-9]+).html$&nbsp;$1\/index.php?m=content&amp;amp;c=index&amp;amp;a=show&amp;amp;catid=$2&amp;amp;id=&nbsp;\n$3&amp;amp;page=$4\nRewriteRule&nbsp;^(.*)list-([0-9]+)-([0-9]+).html$&nbsp;$1\/index.php?m=content&amp;amp;c=index&amp;amp;a=lists&amp;amp;catid=$2&amp;amp;page=$3<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u7684\u662f.htaccess\u89c4\u5219\u3002<\/p>\n<p>\u8981\u662f\u60f3\u5728\u672c\u5730\u6d4b\u8bd5\uff0c\u4f8b\u5982 127.0.0.1\/my2400\uff0c\u56e0\u4e3a\u4e0d\u662f\u6839\u76ee\u5f55\u8bbf\u95ee\uff0c\u6240\u4ee5\u628a\u4ee5\u4e0a\u4ee3\u7801\u6539\u5199\u5982\u4e0b(\u591a\u4e86\u4e2a\/my2400)\uff1a<\/p>\n<pre>RewriteEngine&nbsp;On\nRewriteRule&nbsp;^(.*)content-([0-9]+)-([0-9]+)-([0-9]+).html$&nbsp;$1\/my2400\/index.php?m=content&amp;amp;c=index&amp;amp;a=show&amp;amp;catid=&nbsp;$2&amp;amp;id=\n$3&amp;amp;page=$4\nRewriteRule&nbsp;^(.*)show-([0-9]+)-([0-9]+)-([0-9]+).html$&nbsp;$1\/my2400\/index.php?m=content&amp;amp;c=index&amp;amp;a=show&amp;amp;catid=$2&amp;amp;id=&nbsp;\n$3&amp;amp;page=$4\nRewriteRule&nbsp;^(.*)list-([0-9]+)-([0-9]+).html$&nbsp;$1\/my2400\/index.php?m=content&amp;amp;c=index&amp;amp;a=lists&amp;amp;catid=$2&amp;amp;page=$3<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4e09\u3001PHPCMS V9\u540e\u53f0\u8bbe\u7f6e\u5206\u7c7b\u680f\u76ee\u3002<\/p>\n<p>\u4f4d\u7f6e\uff1a\u5185\u5bb9-&gt;\u7ba1\u7406\u680f\u76ee-&gt;\u6dfb\u52a0\u680f\u76ee<\/p>\n<p>\u6ce8\u610f\u8bbe\u7f6e\u7b2c\u4e8c\u9009\u9879\u5361\uff0c\u201c\u751f\u6210HTML\u8bbe\u7f6e\u201d<\/p>\n<p>\u680f\u76ee\u9875URL\u89c4\u5219\uff1alist-1-2-1.html<\/p>\n<p>\u5185\u5bb9\u9875URL\u89c4\u5219\uff1acontent-1-2-1.html<\/p>\n<p>\u56db\u3001\u6279\u91cf\u66f4\u65b0URL\uff0c\u5b8c\u6210\u4f2a\u9759\u6001\u8bbe\u7f6e\u3002<\/p>\n<p>\u76f8\u5173\u6587\u7ae0\u6559\u7a0b\u63a8\u8350\uff1a\/&#8221; target=&#8221;_blank&#8221;&gt;phpcms\u6559\u7a0b<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5168\u7ad9\u4f2a\u9759\u6001\u8bbe\u7f6e\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>\u4e00\u3001\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u652f\u6301rewrite \u4f8b\u5982\u672c\u5730\u5f00\u542frewrite\u65b9\u6cd5\u5982\u4e0b\uff1a Apache \u914d\u7f6e\u6587\u4ef6 httpd.conf 1\u3001 LoadModule&nbsp;rewrite_module&nbsp;modules\/mod_rewrite.so \u767b\u5f55\u540e\u590d\u5236 \u628a\u8fd9\u53e5\u7684\u201c#\u201d\u6ce8\u91ca\u6389\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b 2\u3001 AllowOverride&nbsp;none \u767b\u5f55\u540e\u590d\u5236 \u6539\u4e3a AllowOverride&nbsp;all \u767b\u5f55\u540e\u590d\u5236 3\u3001\u91cd\u542fapache\u670d\u52a1\u5668\u3002 \u4e8c\u3001\u51c6\u5907.htaccess\u6587\u4ef6\uff08\u5982\u4f55\u5efa\u7acb. htaccess \uff09 \u82e5\u662fwindows\uff0c\u53ef\u4ee5\u4f7f\u7528\u8bb0\u4e8b\u672c\uff0c\u4fdd\u5b58\u9009\u62e9\u53e6\u5b58\u4e3a\uff0c&#8221;.htaccess&#8221; \uff0c\u6ce8\u610f\u547d\u540d\u65f6\u8981\u52a0\u4e0a&#8221;&#8221;\uff0c\u5f97\u5230.htaccess\u6587\u4ef6\uff0c\u7136\u540e\u628a\u4ee5\u4e0b\u4ee3\u7801\u5199\u8fdb\u53bb\u4fdd\u5b58\u3002 RewriteEngine&nbsp;On RewriteRule&nbsp;^(.*)content-([0-9]+)-([0-9]+)-([0-9]+).html$&nbsp;$1\/index.php?m=content&amp;amp;c=index&amp;amp;a=show&amp;amp;catid=$2&amp;amp;id=&nbsp; $3&amp;amp;page=$4 RewriteRule&nbsp;^(.*)show-([0-9]+)-([0-9]+)-([0-9]+).html$&nbsp;$1\/index.php?m=content&amp;amp;c=index&amp;amp;a=show&amp;amp;catid=$2&amp;amp;id=&nbsp; $3&amp;amp;page=$4 RewriteRule&nbsp;^(.*)list-([0-9]+)-([0-9]+).html$&nbsp;$1\/index.php?m=content&amp;amp;c=index&amp;amp;a=lists&amp;amp;catid=$2&amp;amp;page=$3 \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u7684\u662f.htaccess\u89c4\u5219\u3002 \u8981\u662f\u60f3\u5728\u672c\u5730\u6d4b\u8bd5\uff0c\u4f8b\u5982 127.0.0.1\/my2400\uff0c\u56e0\u4e3a\u4e0d\u662f\u6839\u76ee\u5f55\u8bbf\u95ee\uff0c\u6240\u4ee5\u628a\u4ee5\u4e0a\u4ee3\u7801\u6539\u5199\u5982\u4e0b(\u591a\u4e86\u4e2a\/my2400)\uff1a RewriteEngine&nbsp;On RewriteRule&nbsp;^(.*)content-([0-9]+)-([0-9]+)-([0-9]+).html$&nbsp;$1\/my2400\/index.php?m=content&amp;amp;c=index&amp;amp;a=show&amp;amp;catid=&nbsp;$2&amp;amp;id= $3&amp;amp;page=$4 RewriteRule&nbsp;^(.*)show-([0-9]+)-([0-9]+)-([0-9]+).html$&nbsp;$1\/my2400\/index.php?m=content&amp;amp;c=index&amp;amp;a=show&amp;amp;catid=$2&amp;amp;id=&nbsp; $3&amp;amp;page=$4 RewriteRule&nbsp;^(.*)list-([0-9]+)-([0-9]+).html$&nbsp;$1\/my2400\/index.php?m=content&amp;amp;c=index&amp;amp;a=lists&amp;amp;catid=$2&amp;amp;page=$3 \u767b\u5f55\u540e\u590d\u5236 \u4e09\u3001PHPCMS V9\u540e\u53f0\u8bbe\u7f6e\u5206\u7c7b\u680f\u76ee\u3002 \u4f4d\u7f6e\uff1a\u5185\u5bb9-&gt;\u7ba1\u7406\u680f\u76ee-&gt;\u6dfb\u52a0\u680f\u76ee \u6ce8\u610f\u8bbe\u7f6e\u7b2c\u4e8c\u9009\u9879\u5361\uff0c\u201c\u751f\u6210HTML\u8bbe\u7f6e\u201d \u680f\u76ee\u9875URL\u89c4\u5219\uff1alist-1-2-1.html \u5185\u5bb9\u9875URL\u89c4\u5219\uff1acontent-1-2-1.html \u56db\u3001\u6279\u91cf\u66f4\u65b0URL\uff0c\u5b8c\u6210\u4f2a\u9759\u6001\u8bbe\u7f6e\u3002 \u76f8\u5173\u6587\u7ae0\u6559\u7a0b\u63a8\u8350\uff1a\/&#8221; target=&#8221;_blank&#8221;&gt;phpcms\u6559\u7a0b \u4ee5\u4e0a\u5c31\u662f\u5168\u7ad9\u4f2a\u9759\u6001\u8bbe\u7f6e\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-31229","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31229","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=31229"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31229\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}