{"id":80,"date":"2019-07-23T20:12:55","date_gmt":"2019-07-23T20:12:55","guid":{"rendered":"http:\/\/www.jayjaydream.com\/?p=80"},"modified":"2019-08-05T23:00:40","modified_gmt":"2019-08-05T23:00:40","slug":"wordpress%e5%b7%a5%e4%bd%9c%e5%8e%9f%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.jayjaydream.com\/?p=80","title":{"rendered":"WordPress\u5de5\u4f5c\u539f\u7406"},"content":{"rendered":"<p>WP\u521d\u59cb\u5316\u7684\u8fc7\u7a0b\uff1a\u5f53\u4f60\u8f93\u5165&lt;yourlink&gt;\/wordpress\u5bf9wordpress\u8fdb\u884c\u521d\u59cb\u5316\u65f6\uff0cwordpress\u9ed8\u8ba4\u4f1a\u627e<br \/>\n\u6839\u76ee\u5f55\u4e0b\u7684index.php\u9875\u9762\uff0c\u770b\u4e00\u4e0bindex.php\u9875\u9762\u3002<br \/>\n&lt;?php<br \/>\ndefine(&#8216;WP_USE_THEMES&#8217;, true);<br \/>\n\/** Loads the WordPress Environment and Template *\/<br \/>\nrequire(&#8216;.\/wp-blog-header.php&#8217;); &#8212;\u628a\/wp-blog-header.php\u5305\u542b\u8fdb\u6765<br \/>\n?&gt;<br \/>\n\u4f60\u4f1a\u53d1\u73b0\uff0c\u5b83\u4f1a\u53bb\u8c03\u7528\u6839\u76ee\u5f55\u4e0b\u7684wp-blog-header.php\uff0c\u6211\u4eec\u7ee7\u7eed\u770bwp-blog-header.php\u3002<\/p>\n<p>&lt;?php<br \/>\nif ( !isset($wp_did_header) ) {<br \/>\n$wp_did_header = true;<br \/>\nrequire_once( dirname(__FILE__) . &#8216;\/wp-load.php&#8217; );\u00a0 &#8212;\u52a0\u8f7dwp-load.php<br \/>\nwp();\u00a0 &#8212;\u52a0\u8f7dfunction WP();<br \/>\nrequire_once( ABSPATH . WPINC . &#8216;\/template-loader.php&#8217; );\u00a0\u00a0 &#8212;\u52a0\u8f7d\u6a21\u677f\u6587\u4ef6<br \/>\n}<br \/>\n?&gt;<br \/>\n\u901a\u8fc7wp-load.php\uff0cwordpress\u5148\u540e\u628awp-config.php, wp-setting.php,classes.php,fucntions.php\uff0c<br \/>\nquery.php\u7b49\u6587\u4ef6\u52a0\u8f7d\u8fdb\u6765,\u5e76\u5efa\u7acb\u4e86\u4e09\u4e2a\u5168\u5c40\u53d8\u91cf,$wp_the_query,$wp_rewrite\u548c$wp ,\u5206\u522b\u4e3aWP_Query,<br \/>\nWP_Rewrite\u548cWP\u7c7b\u7684\u5b9e\u4f8b\u3002\u7136\u540e,wp-blog-header\u6267\u884cwp()\u51fd\u6570,\u5e76\u901a\u8fc7\u5176\u8c03\u7528$wp\u6240\u5c5eWP\u7c7b\u7684main\u65b9\u6cd5,<br \/>\n\u8fd9\u4e2a\u65b9\u6cd5\u53c8\u8c03\u7528\u4e00\u7cfb\u5217\u65b9\u6cd5,\u4f46\u6700\u91cd\u8981\u7684\u662fparse_request\u65b9\u6cd5, WP\u4ece\u8fd9\u91cc\u5f00\u59cb\u89e3\u6790URL\u5e76\u5efa\u7acb\u4e3b\u5faa\u73af\u3002<br \/>\n\u6211\u4eec\u770b\u4e00\u4e0bwordpress\u7684\u4e3b\u65b9\u6cd5\uff1a<br \/>\nfunction main($query_args = &#8221;) {<br \/>\n$this-&gt;init();\u00a0 &#8211;\u521d\u59cb\u5316\u73af\u5883<br \/>\n$this-&gt;parse_request($query_args);\u00a0\u00a0 &#8211;\u89e3\u6790\u8bf7\u6c42<br \/>\n$this-&gt;send_headers();\u00a0 &#8211;\u53d1\u9001\u5934\u4fe1\u606f<br \/>\n$this-&gt;query_posts();\u00a0 &#8211;\u67e5\u8be2\u65e5\u5fd7<br \/>\n$this-&gt;handle_404();\u00a0\u00a0 &#8211;\u64cd\u4f5c404(URL\u5730\u5740\u4e0d\u5b58\u5728)<br \/>\n$this-&gt;register_globals();\u00a0 &#8211;\u6ce8\u518c\u5168\u5c40\u53d8\u91cf<br \/>\ndo_action_ref_array(&#8216;wp&#8217;, array(&amp;$this));<br \/>\n}<br \/>\n\u8fd9\u57fa\u672c\u4e0a\u5c31\u662fwordpress\u521d\u59cb\u5316\u65f6\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u4e0b\u9762\u5c31\u8ba8\u8bba\u4e00\u4e0b\u5f53\u6211\u4eec\u8bbe\u7f6e\u81ea\u5b9a\u4e49\u7684\u6c38\u4e45\u94fe\u63a5\u65f6\uff0cwordpress\u7684\u8fd0\u4f5c\u8fc7\u7a0b\u3002<br \/>\n\u5f53\u6211\u4eec\u4f7f\u7528\u4e86\u81ea\u5b9a\u4e49\u7684\u6c38\u4e45\u94fe\u63a5\u7684\u65f6\u5019\uff0cwordpress\u4f1a\u81ea\u52a8\u751f\u6210.htaccess\u6587\u4ef6\uff0c\u5e76\u4e14\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u751f\u6210\u76f8<br \/>\n\u5bf9\u5e94\u4e8e\u6c38\u4e45\u94fe\u63a5\u7684\u5339\u914d\u89c4\u5219\uff0c\u5728wordpress\/wp-includes\/rewrite.php\u4e2d\u6709\u9488\u5bf9.htaccess\u6587\u4ef6\u7684\u91cd\u5199\u89c4\u5219\uff0c\u5176<br \/>\n\u4e2d$use_verbose_rules\u53c2\u6570\u89c4\u5b9a\u4e86\u8f93\u51fa\u4fe1\u606f\u7684\u8be6\u5c3d\u548c\u7b80\u7ea6\uff0c\u9ed8\u8ba4\u7684\u60c5\u51b5\u4e0b\u4e3afalse\u3002\u8f93\u51fa\u7684\u4fe1\u606f\u6bd4\u8f83\u7b80\u5355\uff0c<\/p>\n<p>\u5982\u4e0b<br \/>\n# BEGIN WordPress<br \/>\n&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\nRewriteBase \/<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\nRewriteRule . \/index.php [L]<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p># END WordPress<br \/>\n\u5982\u679c\u60f3\u67e5\u770b\u5b8c\u6574\u7684\u5339\u914d\u89c4\u5219\uff0c\u5c31\u628a$use_verbose_rules\u8bbe\u7f6e\u4e3atrue\u3002<br \/>\nwordpress\u5728\u5bf9\u4f7f\u7528\u4e86\u81ea\u5b9a\u4e49\u7684\u6c38\u4e45\u94fe\u63a5\u8fdb\u884c\u5904\u7406\u65f6\uff0c\u5b83\u8fd8\u662f\u4f1a\u8c03\u7528wp-include\/classes.php\u6587\u4ef6\u4e2d<br \/>\n\u7684parse_request\u51fd\u6570\uff0c\u5bf9\u53d1\u8fc7\u6765\u7684\u8bf7\u6c42\u8fdb\u884c\u89e3\u6790\uff0c\u65e0\u8bba\u662f\u5426\u4e3apathinfo\u7c7b\u578b\u7684\u8bf7\u6c42\uff0c\u90fd\u4f1a\u88ab\u8d4b\u503c\u7ed9<br \/>\n$request\u53c2\u6570\uff0c\u7136\u540e\u8c03\u7528\u8be5\u53c2\u6570\u4e0e.htaccess\u4e2d\u7684\u89c4\u5219\u8fdb\u884c\u5339\u914d\uff0c\u5982\u679c\u627e\u5230\u4e00\u4e2a\u5339\u914d\u5c31\u4f1a\u201c\u53d1\u9001\u5934\u4fe1\u606f\u201d<br \/>\n\u3001\u201c\u67e5\u8be2\u65e5\u5fd7\u201d\uff0c\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u5339\u914d\u5c31\u4f1a\u8fd4\u56de404\u9519\u8bef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WP\u521d\u59cb\u5316\u7684\u8fc7\u7a0b\uff1a\u5f53\u4f60\u8f93\u5165&lt;yourlink&gt;\/wordpress\u5bf9 &hellip; <a href=\"https:\/\/www.jayjaydream.com\/?p=80\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[31],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-46","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":1,"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jayjaydream.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}