{"id":577,"date":"2020-10-12T10:42:44","date_gmt":"2020-10-12T02:42:44","guid":{"rendered":"https:\/\/www.cxybj.com\/?p=577"},"modified":"2020-10-12T10:42:45","modified_gmt":"2020-10-12T02:42:45","slug":"thinkphp6%e5%a4%9a%e5%85%a5%e5%8f%a3%e6%96%87%e4%bb%b6%e7%9a%84%e5%ba%94%e7%94%a8%e5%92%8c%e9%9a%90%e8%97%8f%e4%bf%ae%e6%94%b9","status":"publish","type":"post","link":"https:\/\/www.cxybj.com\/?p=577","title":{"rendered":"thinkphp6\u591a\u5165\u53e3\u6587\u4ef6\u7684\u5e94\u7528\u548c\u9690\u85cf\u4fee\u6539"},"content":{"rendered":"\n<p><strong>1.\u5982\u524d\u540e\u53f0\u5206\u522b\u662findex\u548cadmin<\/strong><br><strong>\u5c31\u5728public\u76ee\u5f55\u4e0b\u5efa2\u4e2a\u5165\u53e3\u6587\u4ef6\uff1a<\/strong><br>admin.php\u00a0 \u00a0\u540e\u53f0<br>index.php\u00a0 \u00a0 \u00a0\u524d\u53f0<\/p>\n\n\n\n<p><strong>2.\u5728route\u6587\u4ef6\u4e0b\uff0c\u5206\u522b\u5efa\u524d\u540e\u53f0\u7684\u8def\u7531\u6587\u4ef6<\/strong><br><strong>admin\/app.php<\/strong>\u4ee3\u7801\u5982\u4e0b\uff1a<br>&lt;?php<br>use think\\facade\\Route;<br>Route::get(&#8216;admin\/&#8217;, &#8216;index\/index&#8217;);<br>Route::get(&#8216;admin\/weclome&#8217;, &#8216;index\/weclome&#8217;)->name(&#8216;weclome&#8217;);<\/p>\n\n\n\n<p><strong>index\/route.php <\/strong>\u4ee3\u7801\u5982\u4e0b\uff1a<br>&lt;?php<br>use think\\facade\\Route;<br>Route::get(&#8221;, &#8216;index\/index&#8217;);<br>Route::get(&#8216;hello&#8217;, &#8216;index\/hello&#8217;);<\/p>\n\n\n\n<p><strong>3.\u4fee\u6539public\u76ee\u5f55.htaccess\u6587\u4ef6\u91cc\u4ee3\u7801\u5982\u4e0b<\/strong>\uff1a<\/p>\n\n\n\n<p>Options +FollowSymlinks -Multiviews<br>RewriteEngine On<br>RewriteCond %{REQUEST_FILENAME} !-d<br>RewriteCond %{REQUEST_FILENAME} !-f<br>RewriteRule ^admin(.<em>)$ admin.php [L,E=PATH_INFO:$1] RewriteRule !^index(.<\/em>)$ index.php\/index\/ [L,E=PATH_INFO:$1]<br><br>Ok,\u591a\u5165\u53e3\u5e94\u7528\u5165\u53e3\u6587\u4ef6\u5c31\u9690\u85cf\u4e86.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u5982\u524d\u540e\u53f0\u5206\u522b\u662findex\u548cadmin\u5c31\u5728public\u76ee\u5f55 &hellip; <a href=\"https:\/\/www.cxybj.com\/?p=577\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,133],"tags":[],"_links":{"self":[{"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/posts\/577"}],"collection":[{"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=577"}],"version-history":[{"count":1,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/posts\/577\/revisions"}],"predecessor-version":[{"id":578,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/posts\/577\/revisions\/578"}],"wp:attachment":[{"href":"https:\/\/www.cxybj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}