{"id":643,"date":"2016-06-09T15:30:02","date_gmt":"2016-06-09T07:30:02","guid":{"rendered":"http:\/\/www.tte.cc\/?p=643"},"modified":"2016-06-09T15:30:02","modified_gmt":"2016-06-09T07:30:02","slug":"wordpressphp%e5%8a%a0%e9%80%9f%ef%bc%9a%e9%a6%96%e9%a1%b5%e9%9d%99%e6%80%81%e5%8c%96%e8%b6%85%e5%bc%ba%e6%8f%90%e9%ab%98%e9%80%9f%e5%ba%a6-%e7%94%9f%e6%88%90html","status":"publish","type":"post","link":"https:\/\/www.lnlog.cn\/index.php\/2016\/06\/09\/wordpressphp%e5%8a%a0%e9%80%9f%ef%bc%9a%e9%a6%96%e9%a1%b5%e9%9d%99%e6%80%81%e5%8c%96%e8%b6%85%e5%bc%ba%e6%8f%90%e9%ab%98%e9%80%9f%e5%ba%a6-%e7%94%9f%e6%88%90html\/","title":{"rendered":"wordpress,php\u52a0\u901f\uff1a\u9996\u9875\u9759\u6001\u5316\u8d85\u5f3a\u63d0\u9ad8\u901f\u5ea6 \u751f\u6210html"},"content":{"rendered":"<p>wordpress,php\u52a0\u901f\uff1a\u9996\u9875\u9759\u6001\u5316\u8d85\u5f3a\u63d0\u9ad8\u901f\u5ea6 \u751f\u6210html<\/p>\n<p>1\u3001\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3aindex_html.php\u7684\u6587\u4ef6\u5e76\u52a0\u5165\u4e00\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>&lt;?php<br \/>\nif(file_exists(&#8220;index.html&#8221;))<br \/>\n{<br \/>\nunlink(&#8220;index.html&#8221;);<br \/>\n}<br \/>\n$baseCmsUrl = &#8220;http:\/\/www.tte.cc&#8221;;<br \/>\n$dmPageName = &#8220;index.php&#8221;;<br \/>\n$stPageName = &#8220;index.html&#8221;;<br \/>\n$tureStFile = dirname(__FILE__).&#8217;\/&#8217;.$stPageName;<br \/>\n{<br \/>\n$body = file_get_contents($baseCmsUrl.&#8217;\/&#8217;.$dmPageName);<br \/>\n$fp = fopen($tureStFile, &#8216;w&#8217;);<br \/>\nfwrite($fp, $body);<br \/>\nfclose($fp);<br \/>\n}<br \/>\nheader(&#8220;Location:$baseCmsUrl\/index.html&#8221;);<br \/>\n?&gt;<br \/>\n2\u3001\u751f\u6210index.html\u6587\u4ef6\u540e\uff0c\u6211\u4eec\u8981\u6ce8\u610f\u7684\u662f\u6211\u4eec\u76f4\u63a5\u8bbf\u95ee\u81ea\u5df1\u7684\u57df\u540d\u548c\u8bbf\u95ee\u57df\u540d+index.html\u90fd\u4f1a\u663e\u793a\u9996\u9875\u8fd9\u6837\u7684\u4f1a\u641c\u7d22\u5f15\u64ce\u4f1a\u8ba4\u4e3a\u4f60\u5728\u5236\u9020\u91cd\u590d\u9875\u9762\uff0c\u4f1a\u7ed9\u7f51\u7ad9\u5e26\u6765\u4e00\u5b9a\u7684\u8d1f\u9762\u5f71\u54cd\uff0c\u4e0b\u9762\u5c0fV\u7ed9\u51fa\u89e3\u51b3\u6b64\u95ee\u9898\u7684\u65b9\u6cd5\uff08\u8bbf\u95eeindex.html301\u8f6c\u8df3\u5230\/\uff0c\u5373\u53bb\u9664\u6389\u9996\u9875url\u4e2d\u7684index.html\uff09\uff1a\u5c06\u6587\u4ef6\u4e0a\u4f20\u5230\u7f51\u7ad9\u6839\u76ee\u5f55\u540e\u76f4\u63a5\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u8be5\u6587\u4ef6\u5373\u53ef\u4e3awordpress\u9996\u9875\u751f\u6210html\u3002<\/p>\n<p>apache\u4e0b\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a<br \/>\nRewriteEngine On<br \/>\nRewriteBase \/<br \/>\nRewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\\ \/index\\.(php|html|htm)\\ HTTP\/<br \/>\nRewriteRule ^index\\.(php|html|htm)$ http:\/\/www.tte.cc\/ [R=301,L]<\/p>\n<p>nginx\u4e0b\u7684\u89e3\u51b3\u65b9\u6cd5<br \/>\nlocation \/ {<br \/>\nif (!-e $request_filename){<br \/>\nrewrite ^\/(.*)$ \/index.html\/$1 last;<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>wordpress,php\u52a0\u901f\uff1a\u9996\u9875\u9759\u6001\u5316\u8d85\u5f3a\u63d0\u9ad8\u901f\u5ea6 \u751f\u6210html 1\u3001\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3aindex_html.p &hellip; <a href=\"https:\/\/www.lnlog.cn\/index.php\/2016\/06\/09\/wordpressphp%e5%8a%a0%e9%80%9f%ef%bc%9a%e9%a6%96%e9%a1%b5%e9%9d%99%e6%80%81%e5%8c%96%e8%b6%85%e5%bc%ba%e6%8f%90%e9%ab%98%e9%80%9f%e5%ba%a6-%e7%94%9f%e6%88%90html\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">wordpress,php\u52a0\u901f\uff1a\u9996\u9875\u9759\u6001\u5316\u8d85\u5f3a\u63d0\u9ad8\u901f\u5ea6 \u751f\u6210html<\/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":[5],"tags":[94,326],"class_list":["post-643","post","type-post","status-publish","format-standard","hentry","category-tech","tag-wordpress","tag-326"],"_links":{"self":[{"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/posts\/643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=643"}],"version-history":[{"count":0,"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/posts\/643\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lnlog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}