{"id":255,"date":"2021-10-10T22:51:39","date_gmt":"2021-10-10T14:51:39","guid":{"rendered":"http:\/\/kkong.net\/?p=255"},"modified":"2021-10-10T22:51:39","modified_gmt":"2021-10-10T14:51:39","slug":"h5ai-%e4%b8%ad%e6%96%87%e7%9b%ae%e5%bd%95%e5%8f%8a%e6%96%87%e4%bb%b6%e5%9d%87%e4%b8%ba%e4%b9%b1%e7%a0%81404%e6%97%a0%e6%b3%95%e4%b8%8b%e8%bd%bd%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"https:\/\/kkong.net\/?p=255","title":{"rendered":"H5ai \u4e2d\u6587\u76ee\u5f55\u53ca\u6587\u4ef6\u5747\u4e3a\u4e71\u7801404\u65e0\u6cd5\u4e0b\u8f7d\u89e3\u51b3\u529e\u6cd5"},"content":{"rendered":"\n<p><br>\u90e8\u7f72\u5728windows\u4e0bupupw\u7684\u8fd0\u884c\u73af\u5883\uff0c\u4f1a\u6709\u4e2d\u6587\u76ee\u5f55\u663e\u793a\u4e71\u7801\uff0c\u6253\u5f00 \u4e2d\u6587\u76ee\u5f55\u63d0\u793a404\u7684\u95ee\u9898\u3002<br>\u6700\u65b0\u7248\u652f\u6301\u4e2d\u6587\u76ee\u5f55\uff0c\u4f46\u662f\u5fc5\u987b\u5c06\u670d\u52a1\u5668\u7cfb\u7edf\u8bed\u8a00\u6539\u4e3azh_CN.UTF-8(linux)<br>\u8fd9\u91cc\u4fee\u6539\u4e24\u884c\u4ee3\u7801\u5373\u53ef\u89e3\u51b3\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\\_h5ai\\private\\php\\core\\class-context.php<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>public function to_href($path, $trailing_slash = true) {<br>$rel_path = substr($path, strlen($this-&gt;setup-&gt;get(\u2018ROOT_PATH\u2019)));<br>$parts = explode(\u2018\/\u2019, $rel_path);<br>$encoded_parts = [];<br>foreach ($parts as $part) {<br>if ($part != \u201d) {<br>\/\/ $encoded_parts[] = rawurlencode($part);<br><span style=\"color: #ff0000;\">$encoded_parts[] = rawurlencode(mb_convert_encoding($part, \"UTF-8\", \"GBK\")); \/\/rawurlencode($part);<\/span><br>}<br>}<br>return Util::normalize_path($this-&gt;setup-&gt;get('ROOT_HREF') . implode('\/', $encoded_parts), $trailing_slash);<br>}<br>public function to_path($href) {<br>$rel_href = substr($href, strlen($this-&gt;setup-&gt;get('ROOT_HREF')));<br>\/\/return Util::normalize_path($this-&gt;setup-&gt;get('ROOT_PATH') . '\/' . rawurldecode($rel_href));<br><span style=\"color: #ff0000;\">return Util::normalize_path($this-&gt;setup-&gt;get('ROOT_PATH') . '\/' . iconv( 'UTF-8', 'GBK', rawurldecode($rel_href) ));\/\/rawurldecode($rel_href));<\/span><br>}<\/p><\/blockquote>\n\n\n\n<p>\u627e\u5230\u4e0a\u9762\u8fd9\u4e24\u4e2a\u51fd\u6570\uff0c\u5c06\u7ea2\u8272\u90e8\u5206\u4fee\u6539\u4e3a\u4e0a\u9762\u4ee3\u7801\u5373\u53ef\u3002<br>---------------------------------------------------<br>\u5173\u4e8eNginx\u4e0b\u8bbe\u7f6e\u90e8\u5206\u52a0\u5bc6\u6587\u4ef6\u5939\u529f\u80fd\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u8bbe\u7f6e\u7f51\u7ad9\u914d\u7f6e\u6587\u4ef6\uff0c\u4ee5AMH\u9762\u677f\u4e3a\u4f8b\uff1a\/usr\/local\/nginx\/conf\/rewrite\/down.conf<\/p><p>#\u7981\u6b62\u8bbf\u95ee.ht\u5f00\u5934\u7684\u4efb\u4f55\u6587\u4ef6<br>location ~ \/\\.ht {<br>deny all;<br>}<br>#\u5bf9secrect\u76ee\u5f55\u4f7f\u7528\u5bc6\u7801\u8ba4\u8bc1,\u5e76\u4f7f\u7528Apache .htpasswd\u6587\u4ef6\u4fdd\u5b58\u5bc6\u7801<br>location ^~ \/secrect\/ {<br>root \/home\/wwwroot\/www.chenbo.info\/web;<br>autoindex on;<br>autoindex_exact_size off;<br>autoindex_localtime on;<br>auth_basic \"Please input Password:\";<br>auth_basic_user_file \/home\/wwwroot\/www.chenbo.info\/web\/secrect\/.htpasswd;<br>}<\/p><\/blockquote>\n\n\n\n<p>\u521b\u5efa\/home\/wwwroot\/down.chenbo.info\/web\/secrect\/\u76ee\u5f55\u4e0b.htpasswd\u6587\u4ef6\uff0c\u5e76\u5c06\u751f\u6210\u7684\u8d26\u53f7\u5bc6\u7801\u6dfb\u52a0\u8fdb\u53bb\u3002<br>\u5bc6\u7801\u751f\u6210\u7f51\u5740\uff1ahttp:\/\/tool.oschina.net\/htpasswd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u90e8\u7f72\u5728windows\u4e0bupupw\u7684\u8fd0\u884c\u73af\u5883\uff0c\u4f1a\u6709\u4e2d\u6587\u76ee\u5f55\u663e\u793a\u4e71\u7801\uff0c\u6253\u5f00 \u4e2d\u6587\u76ee\u5f55\u63d0\u793a404\u7684\u95ee\u9898\u3002\u6700\u65b0\u7248\u652f\u6301\u4e2d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/posts\/255"}],"collection":[{"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kkong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=255"}],"version-history":[{"count":1,"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":256,"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/posts\/255\/revisions\/256"}],"wp:attachment":[{"href":"https:\/\/kkong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kkong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kkong.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}