{"id":33,"date":"2013-11-28T08:04:26","date_gmt":"2013-11-28T00:04:26","guid":{"rendered":"http:\/\/www.yptk.cn\/index.php\/2013\/11\/28\/%e7%ab%99%e9%95%bf%e5%b8%b8%e7%94%a8%e4%bb%a3%e7%a0%81\/"},"modified":"2013-11-28T08:04:26","modified_gmt":"2013-11-28T00:04:26","slug":"%e7%ab%99%e9%95%bf%e5%b8%b8%e7%94%a8%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"http:\/\/yptk.cn\/index.php\/2013\/11\/28\/%e7%ab%99%e9%95%bf%e5%b8%b8%e7%94%a8%e4%bb%a3%e7%a0%81\/","title":{"rendered":"\u7ad9\u957f\u5e38\u7528\u4ee3\u7801"},"content":{"rendered":"<h2 style=\"font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;color:#333333;font-size:24px;background-color:#FFFFFF;\">\n\t.htaccess \u914d\u7f6e<br \/>\n<\/h2>\n<blockquote style=\"color:#333333;font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;font-size:14px;background-color:#FFFFFF;\">\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t301\u91cd\u5b9a\u5411<br \/>\n\t<\/h4>\n<pre>RewriteEngine On\nRewriteCond %{HTTP_HOST} !^www.pandaidea.com$ [NC]\nRewriteRule ^(.*)$ http:\/\/www.pandaidea.com\/$1 [L,R=301]<\/pre>\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u81ea\u5b9a\u4e49404\u9875\u9762<br \/>\n\t<\/h4>\n<pre>ErrorDocument 404 \/404.html<\/pre>\n<div class=\"alert alert-info\" style=\"padding:8px 35px 8px 14px;color:#3A87AD;background-color:#D9EDF7;border:0px;font-size:12px;\">\n\t\t\u6ce8\u610f\u9875\u9762\u5185\u5bb9\u957f\u5ea6\u5fc5\u987b\u5927\u4e8e512\u5b57\u8282,\u5426\u5219\u5728IE\u4e2d\u53ea\u80fd\u663e\u793a\u9ed8\u8ba4404\u9875\u9762\n\t<\/div>\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u76ee\u5f55\u5185\u7981\u6b62\u6267\u884cPHP<br \/>\n\t<\/h4>\n<pre>&lt;Files ~ \".php\"&gt;\nOrder allow,deny\nDeny from all\n&lt;\/Files&gt;<\/pre>\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u7981\u6b62\u67d0\u4e2aIP\/\u6bb5\u8bbf\u95ee<br \/>\n\t<\/h4>\n<pre>Deny from 60.190.17.*<\/pre>\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\tRewrite\u89c4\u5219 for wordpress<br \/>\n\t<\/h4>\n<pre>RewriteEngine On\nRewriteBase \/\nRewriteRule ^index\\.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . \/index.php [L]<\/pre>\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u542f\u7528 GZip \u538b\u7f29<br \/>\n\t<\/h4>\n<p style=\"font-size:16px;\">\n\t\t\u786e\u4fddLoadModule deflate_module modules\/mod_deflate.so\u524d\u7684\u4e95\u53f7\u952e\u5df2\u7ecf\u5220\u9664\uff0c\u5e76\u4e14\u5728httpd.conf\u6216\u8005.htaccess\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a\n\t<\/p>\n<pre>&lt;ifmodule mod_deflate.c&gt;\nDeflateCompressionLevel 9\nAddOutputFilterByType DEFLATE text\/html text\/plain text\/xml application\/x-httpd-php\nAddOutputFilter DEFLATE js css\n&lt;\/ifmodule&gt;<\/pre>\n<p style=\"font-size:16px;\">\n\t\t\u5728\u7ebf\u68c0\u6d4b\u662f\u5426\u542f\u7528gzip:<a href=\"http:\/\/httpcode.pandaidea.com\/\">http:\/\/httpcode.pandaidea.com\/<\/a>\n\t<\/p>\n<\/blockquote>\n<h2 style=\"font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;color:#333333;font-size:24px;background-color:#FFFFFF;\">\n\tPHP\u4ee3\u7801<br \/>\n<\/h2>\n<blockquote style=\"color:#333333;font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;font-size:14px;background-color:#FFFFFF;\">\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t301\u91cd\u5b9a\u5411<br \/>\n\t<\/h4>\n<pre>&lt;?php\n$url=\"http:\/\/www.pandaidea.com\".$_SERVER[\"REQUEST_URI\"];\nheader(\"HTTP\/1.1 301 Moved Permanently\");\nheader (\"Location:$url\");<\/pre>\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t503 \u670d\u52a1\u6682\u65f6\u4e0d\u53ef\u7528<br \/>\n\t<\/h4>\n<pre>&lt;?php\nheader('HTTP\/1.1 503 Service Temporarily Unavailable');\nheader('Status: 503 Service Temporarily Unavailable');<\/pre>\n<div class=\"alert alert-info\" style=\"padding:8px 35px 8px 14px;color:#3A87AD;background-color:#D9EDF7;border:0px;font-size:12px;\">\n\t\t\u5907\u6848\u7b49\u9700\u8981\u4e34\u65f6\u4e0d\u80fd\u6253\u5f00\u7f51\u7ad9\u65f6\u4f7f\u7528\n\t<\/div>\n<blockquote>\n<p style=\"font-size:16px;\">\n\t\t\t<a href=\"http:\/\/zhanzhang.baidu.com\/wiki\/43\">\u672a\u5efa\u597d\u9875\u9762\u5e94\u8fd4\u56de503\u72b6\u6001\u7801\uff0c\u9632\u6b62\u88ab\u5220\u9664<\/a>:503\u8fd4\u56de\u7801\u7684\u542b\u4e49\u662f\u201cService Unavailable\u201d\uff0c\u767e\u5ea6\u4f1a\u8ba4\u4e3a\u8be5\u7f51\u9875\u4e34\u65f6\u4e0d\u53ef\u8bbf\u95ee\uff0c\u901a\u5e38\u7f51\u7ad9\u4e34\u65f6\u5173\u95ed\uff0c\u5e26\u5bbd\u6709\u9650\u7b49\u4f1a\u4ea7\u751f\u8fd9\u79cd\u60c5\u51b5\u3002\u5bf9\u4e8e\u7f51\u9875\u8fd4\u56de503\uff0c\u767e\u5ea6spider\u4e0d\u4f1a\u628a\u8fd9\u6761url\u76f4\u63a5\u5220\u9664\uff0c\u77ed\u671f\u5185\u4f1a\u518d\u8bbf\u95ee\u3002\u5c4a\u65f6\u5982\u679c\u7f51\u9875\u5df2\u6062\u590d\uff0c\u5219\u6b63\u5e38\u6293\u53d6\uff1b\u5982\u679c\u7ee7\u7eed\u8fd4\u56de503\uff0c\u77ed\u671f\u5185\u8fd8\u4f1a\u53cd\u590d\u8bbf\u95ee\u51e0\u6b21\u3002\u4f46\u662f\u5982\u679c\u7f51\u9875\u957f\u671f\u8fd4\u56de503\uff0c\u90a3\u4e48\u8fd9\u4e2aurl\u4ecd\u4f1a\u88ab\u767e\u5ea6\u8ba4\u4e3a\u662f\u5931\u6548\u94fe\u63a5\uff0c\u4ece\u641c\u7d22\u7ed3\u679c\u4e2d\u5220\u9664\u3002\n\t\t<\/p>\n<\/blockquote>\n<h4 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u5220\u9664\u7f51\u7ad9\u4e2d\u6240\u6709\u6587\u4ef6\u7684BOM\u5934<br \/>\n\t<\/h4>\n<pre>&lt;?php\nif (isset($_GET['dir'])){ \/\/\u8bbe\u7f6e\u6587\u4ef6\u76ee\u5f55\n    $basedir=$_GET['dir'];\n}else{\n    $basedir = '.';\n}\n$auto = 1;\ncheckdir($basedir);\nfunction checkdir($basedir){\nif ($dh = opendir($basedir)) {\n  while (($file = readdir($dh)) !== false) {\n   if ($file != '.' &amp;&amp; $file != '..'){\n    if (!is_dir($basedir.\"\/\".$file)) {\n     echo \"filename: $basedir\/$file \".checkBOM(\"$basedir\/$file\").\" &lt;br&gt;\";\n    }else{\n     $dirname = $basedir.\"\/\".$file;\n     checkdir($dirname);\n    }\n   }\n  }\nclosedir($dh);\n}\n}\nfunction checkBOM ($filename) {\nglobal $auto;\n$contents = file_get_contents($filename);\n$charset[1] = substr($contents, 0, 1);\n$charset[2] = substr($contents, 1, 1);\n$charset[3] = substr($contents, 2, 1);\nif (ord($charset[1]) == 239 &amp;&amp; ord($charset[2]) == 187 &amp;&amp; ord($charset[3]) == 191) {\n  if ($auto == 1) {\n      $rest = substr($contents, 3);\n      rewrite ($filename, $rest);\n      return (\"&lt;font color=red&gt;BOM found, automatically removed.&lt;\/font&gt;\");\n  } else {\n   return (\"&lt;font color=red&gt;BOM found.&lt;\/font&gt;\");\n  }\n}\nelse return (\"BOM Not Found.\");\n}\nfunction rewrite ($filename, $data) {\n    $filenum = fopen($filename, \"w\");\n    flock($filenum, LOCK_EX);\n    fwrite($filenum, $data);\n    fclose($filenum);\n}<\/pre>\n<\/blockquote>\n<h2 style=\"font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;color:#333333;font-size:24px;background-color:#FFFFFF;\">\n\tNginx\u89c4\u5219<br \/>\n<\/h2>\n<blockquote style=\"color:#333333;font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;font-size:14px;background-color:#FFFFFF;\">\n<h3 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\tRewrite \u89c4\u5219 for wordpress<br \/>\n\t<\/h3>\n<pre>if (!-e $request_filename){\n    rewrite (.*) \/index.php;\n}<\/pre>\n<\/blockquote>\n<h2 style=\"font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;color:#333333;font-size:24px;background-color:#FFFFFF;\">\n\trobots.txt \u8bed\u6cd5<br \/>\n<\/h2>\n<blockquote style=\"color:#333333;font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;font-size:14px;background-color:#FFFFFF;\">\n<h3 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u5141\u8bb8\u6240\u6709\u673a\u5668\u4eba<br \/>\n\t<\/h3>\n<pre>User-agent: *\nDisallow:<\/pre>\n<p style=\"font-size:16px;\">\n\t\t\u53e6\u4e00\u79cd\u5199\u6cd5:\n\t<\/p>\n<pre>User-agent: *\nAllow:\/<\/pre>\n<h3 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u5168\u7ad9\u7981\u6b62\u6536\u5f55<br \/>\n\t<\/h3>\n<pre>User-agent: *\nDisallow: \/<\/pre>\n<h3 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u7981\u6b62\u67d0\u4e2a\u76ee\u5f55\u6536\u5f55<br \/>\n\t<\/h3>\n<pre>User-agent: *\nDisallow: \/cgi-bin\/<\/pre>\n<h3 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u5728\u7f51\u9875\u4e2d\u7528HTML\u4ee3\u7801\u963b\u6b62robots<br \/>\n\t<\/h3>\n<pre>&lt;meta name=\"robots\" content=\"noindex\" \/&gt;<\/pre>\n<div class=\"alert alert-info\" style=\"padding:8px 35px 8px 14px;color:#3A87AD;background-color:#D9EDF7;border:0px;font-size:12px;\">\n\t\t\u4e3a\u4fdd\u8bc1robots.txt\u7684\u8bed\u6cd5\u6b63\u786e\u53ef\u4f7f\u7528<a href=\"http:\/\/zhanzhang.baidu.com\/robots\">\u767e\u5ea6Robots.txt\u5de5\u5177<\/a>\u751f\u6210\n\t<\/div>\n<\/blockquote>\n<h2 style=\"font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;color:#333333;font-size:24px;background-color:#FFFFFF;\">\n\t\u5176\u4ed6\u4ee3\u7801<br \/>\n<\/h2>\n<blockquote style=\"color:#333333;font-family:Arial, Helvetica, 'Heiti SC', simsun, sans-serif;font-size:14px;background-color:#FFFFFF;\">\n<h3 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u89e3\u9664\u7f51\u9875\u53f3\u952e\u5c4f\u853d<br \/>\n\t<\/h3>\n<pre>javascript:(function() { function R(a){ona = \"on\"+a;if(window.addEventListener) window.addEventListener(a, function(e) { for(var n=e.originalTarget; n; n=n.parentNode) n[ona]=null; },true); window[ona]=null; document[ona]=null; if(document.body)document.body[ona]=null; } R(\"contextmenu\");R(\"click\");R(\"mousedown\"); R(\"mouseup\"); R(\"selectstart\");})()<\/pre>\n<div class=\"alert alert-info\" style=\"padding:8px 35px 8px 14px;color:#3A87AD;background-color:#D9EDF7;border:0px;font-size:12px;\">\n\t\t\u628a\u4ee5\u4e0a\u4ee3\u7801\u52a0\u5165\u6536\u85cf,\u5728\u8981\u89e3\u9664\u5c4f\u853d\u7684\u7f51\u9875\u4e0a\u70b9\u51fb\u6536\u85cf\u94fe\u63a5\n\t<\/div>\n<h3 style=\"font-family:inherit;color:inherit;font-size:18px;\">\n\t\t\u7981\u6b62\u5176\u4ed6\u7f51\u7ad9iframe\u672c\u7ad9\u9875\u9762<br \/>\n\t<\/h3>\n<pre>&lt;script&gt;\nif(top != self){ top.location.href = self.location.href; }\n&lt;\/script&gt;<\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>.htaccess \u914d\u7f6e 301\u91cd\u5b9a\u5411 RewriteEngine On RewriteCond %{HTTP_HOST} !^www.pandaidea.com$ [NC] RewriteRule ^(.*)$ http:\/\/www.pandaidea.com\/$1 [L,R=301] \u81ea\u5b9a\u4e49404\u9875\u9762 ErrorDocument 404 \/404.html \u6ce8\u610f\u9875\u9762\u5185\u5bb9\u957f\u5ea6\u5fc5\u987b\u5927\u4e8e512\u5b57\u8282, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-15"],"_links":{"self":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":0,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"wp:attachment":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}