{"id":20056,"date":"2020-02-06T07:38:01","date_gmt":"2020-02-05T23:38:01","guid":{"rendered":"http:\/\/4563.org\/?p=20056"},"modified":"2020-02-06T07:38:01","modified_gmt":"2020-02-05T23:38:01","slug":"%e3%80%90%e6%8a%80%e6%9c%af%e8%b4%b4%e3%80%91php%e5%85%a8%e8%83%bd%e8%b7%af%e7%94%b1%ef%bc%8c%e8%87%aa%e9%80%82%e5%ba%94%e7%bd%91%e7%ab%99%e8%b7%af%e5%be%84%ef%bc%8c%e9%87%87%e9%9b%86%e7%ab%99","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=20056","title":{"rendered":"\u3010\u6280\u672f\u8d34\u3011PHP\u5168\u80fd\u8def\u7531\uff0c\u81ea\u9002\u5e94\u7f51\u7ad9\u8def\u5f84\uff0c\u91c7\u96c6\u7ad9\u5fc5\u5907"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>30826<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:26:21\t<\/p>\n<h3>\u3010\u6280\u672f\u8d34\u3011PHP\u5168\u80fd\u8def\u7531\uff0c\u81ea\u9002\u5e94\u7f51\u7ad9\u8def\u5f84\uff0c\u91c7\u96c6\u7ad9\u5fc5\u5907<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 30826 \u4e8e 2020-1-18 20:34 \u7f16\u8f91 <\/p>\n<p> \u7f51\u7ad9\u8def\u7531\uff08\u4e0d\u662f\u673a\u623f\u8def\u7531\u5668\uff09\u4e00\u76f4\u662f\u4e2a\u5934\u75bc\u7684\u95ee\u9898\uff0c\u5bf9\u4e8e\u7f51\u7ad9\u8def\u5f84\u5e02\u9762\u4e0a\u6709\u4e24\u79cd\u89e3\u51b3\u65b9\u6848\uff1a<br \/>  1. \u7528\u6237\u8f93\u5165\u7f51\u7ad9\u5730\u5740\uff0c\u91c7\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u4f8b\u5982WordPress\u3001Typecho\uff0c\u96be\u4ee5\u5b9e\u73b0\u5355\u7f51\u7ad9\u591a\u57df\u540d\u3002<br \/>  2. \u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u81ea\u9002\u5e94\uff0c\u4f8b\u5982Xiuno\uff0c\u65e0\u6cd5\u5904\u7406\u5e26\u6709\/\u7684URI\u8def\u5f84\u53c2\u6570\u3002<br \/>  \u4e8e\u662f\u5199\u4e86\u4e00\u4e2aPHP\u8def\u7531\uff0c\u53ef\u9002\u7528\u4e8e\u4e8c\u7ea7\u76ee\u5f55\u3001\u65e0\u4f2a\u9759\u6001\u60c5\u51b5\uff0c\u53ef\u5904\u7406\u591a\u7ea7URI\u8def\u5f84\u3001GET\u53c2\u6570\u3002<\/p>\n<p>  \u3010\u6f14\u793a\u3011<br \/>  \u4e3b\u9875\uff1ahttp:\/\/demo.freevar.com\/route\/<br \/>  \u8fd9\u4e2a\u6f14\u793a\u6587\u4ef6\u662f\u4e8c\u7ea7\u76ee\u5f55route\u4e2d\u7684index.php\uff0c\u53ef\u4ee5\u9002\u5e94\u3002<br \/>  \u65e0\u4f2a\u9759\u6001\uff1ahttp:\/\/demo.freevar.com\/route\/index.php\/adfds\/hfdsgsf?a=1&amp;b=2<br \/>  \u5f53\u670d\u52a1\u5668\u4e0d\u652f\u6301\u4f2a\u9759\u6001\u65f6\uff0c\u4f7f\u7528\/index.php\/\u8bbf\u95ee\uff0c\u83b7\u5f97\u540c\u6837\u6548\u679c\u3002<br \/>  \u6709\u4f2a\u9759\u6001\uff1ahttp:\/\/demo.freevar.com\/route\/adfds\/hfdsgsf?a=1&amp;b=2<br \/>  \u5f00\u542f\u4f2a\u9759\u6001\u540e\uff0c\u7f51\u7ad9URL\u5730\u5740\u66f4\u52a0\u7f8e\u89c2\u3002<\/p>\n<p>  \u3010\u8bf4\u660e\u3011<br \/>  \u6587\u4ef6\u6839\u76ee\u5f55\uff1a\u7a0b\u5e8f\u6587\u4ef6\u6240\u5728\u8def\u5f84\uff0c\u7528\u4e8e\u8c03\u7528\u8d44\u6e90\u3002\u4f8b\u5982\u5f15\u7528[\u6587\u4ef6\u6839\u76ee\u5f55\/style.css]\uff0c\u53ef\u4ee5\u6b63\u786e\u5b9a\u4f4d\u5230\u6587\u4ef6\u3002<br \/>  \u7f51\u7ad9\u6839\u76ee\u5f55\uff1a\u7f51\u7ad9\u4e3b\u9875\u5730\u5740\uff0c\u517c\u5bb9\u65e0\u4f2a\u9759\u6001\u3002\u4f8b\u5982\u65e0\u4f2a\u9759\u6001\u65f6\u5c06\u94fe\u63a5\u5230\uff0c\u786e\u4fdd\u53ef\u8bbf\u95ee\u3002<br \/>  \u8bf7\u6c42\u8def\u5f84\uff1a\u7528\u6237\u8bf7\u6c42\u7684\u8def\u5f84\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u53c2\u6570\u8c03\u7528\u3002\u4f8b\u5982\u8bbf\u95ee[\u7f51\u7ad9\/zhuji\/usa.html]\uff0c\u8be5\u53c2\u6570\u4e3a\u3002<br \/>  \u8bf7\u6c42\u53c2\u6570\uff1aGET\u8bf7\u6c42(?)\u540e\u7684\u53c2\u6570\u6570\u7ec4\uff0c\u5355\u72ec\u63d0\u53d6\u4f9b\u8c03\u7528\uff0c\u533a\u522b\u4e8eREQUEST_URI\u3002<br \/>  \u7a0b\u5e8f\u540d\uff1a\u53ef\u4ee5\u4e0d\u662findex.php\uff0c\u4f46\u670d\u52a1\u5668\u8981\u91cd\u65b0\u8bbe\u7f6e\u4e3b\u9875\u4e3a\u8be5\u6587\u4ef6\u3002<\/p>\n<p>  \u3010\u4ee3\u7801\u3011<br \/>  &lt;?php<br \/>  define(&#8216;wenjiangenmulu&#8217;,substr($_SERVER[&#8216;SCRIPT_NAME&#8217;],0,strripos($_SERVER[&#8216;SCRIPT_NAME&#8217;],&#8217;\/&#8217;)+1));<br \/>  define(&#8216;wangzhangenmulu&#8217;,(stripos($_SERVER[&#8216;REQUEST_URI&#8217;],$_SERVER[&#8216;SCRIPT_NAME&#8217;])===0)?$_SERVER[&#8216;SCRIPT_NAME&#8217;].&#8217;\/&#8217;:wenjiangenmulu);<br \/>  define(&#8216;qingqiulujing&#8217;,substr(stristr($_SERVER[&#8216;REQUEST_URI&#8217;],&#8217;?&#8217;,true)?:$_SERVER[&#8216;REQUEST_URI&#8217;],strlen(wangzhangenmulu)));<br \/>  echo &#8216;<br \/>  &lt;!DOCTYPE HTML&gt;<br \/>  &lt;html&gt;<br \/>  &lt;head&gt;<br \/>  &lt;meta charset=&quot;utf-8&quot; \/&gt;<br \/>  &lt;title&gt;\u5168\u80fd\u8def\u7531&lt;\/title&gt;<br \/>  &lt;\/head&gt;<br \/>  &lt;body&gt;<br \/>  &lt;b&gt;\u5168\u80fd\u8def\u7531&lt;\/b&gt;&lt;br \/&gt;<br \/>  [\u6587\u4ef6\u6839\u76ee\u5f55] &#8216;.wenjiangenmulu.'&lt;br \/&gt;<br \/>  [\u7f51\u7ad9\u6839\u76ee\u5f55] &#8216;.wangzhangenmulu.'&lt;br \/&gt;<br \/>  [\u8bf7\u6c42\u8def\u5f84] &#8216;.qingqiulujing.'&lt;br \/&gt;<br \/>  [\u8bf7\u6c42\u53c2\u6570]<br \/>  &lt;br \/&gt;<br \/>  &#8216;;<br \/>  print_r($_GET);<br \/>  echo &#8216;<br \/>  &lt;br \/&gt;<br \/>  [\u670d\u52a1\u5668]<br \/>  &lt;br \/&gt;<br \/>  &#8216;;<br \/>  print_r($_SERVER);<br \/>  echo &#8216;<br \/>  &lt;br \/&gt;<br \/>  &lt;\/body&gt;<br \/>  &lt;\/html&gt;<br \/>  &#8216;;<br \/>  ?&gt;<\/p>\n<p>  \u3010\u670d\u52a1\u5668\u91cd\u5199\u914d\u7f6e\u3011<br \/>  Apache\uff1a<br \/>  RewriteEngine On<br \/>  RewriteCond %{REQUEST_FILENAME} !-f<br \/>  RewriteCond %{REQUEST_FILENAME} !-d<br \/>  RewriteRule ^route\/(.*)$ \/route\/index.php<br \/>  Nginx\uff1a<br \/>  location \/route {<br \/>  try_files $uri $uri\/ \/route\/index.php?$args;<br \/>  }  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>uni2046<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:27:27\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u611f\u89c9\u597d\u725b\u903c\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>30826<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:28:25\t<\/p>\n<h3><\/h3>\n<p>  \t\tuni2046 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:27<br \/>  \u611f\u89c9\u597d\u725b\u903c<\/p>\n<p> \u5927\u4f6c\u591a\u90fd\u592a\u8c26\u865a:lol\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5feb\u96ea\u65f6\u6674<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:30:34\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u73b0\u5728\u4e0d\u90fd\u662f\u6846\u67b6\u561b\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>30826<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:32:25\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5feb\u96ea\u65f6\u6674 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:30<br \/>  \u73b0\u5728\u4e0d\u90fd\u662f\u6846\u67b6\u561b<\/p>\n<p> \u6846\u67b6\u5c40\u9650\u592a\u591a\u4e86\uff0c\u5f88\u591a\u9700\u6c42\u8fd8\u662f\u8981\u81ea\u5df1\u5199\u2026\u2026\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6715\u7684\u5927\u6e05\u5b8c\u4e86\uff1f<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:42:50\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6846\u67b6\u4e0d\u9999\u5417\uff1f<\/p>\n<p>  \u81ea\u5df1\u5199\u7684\u8bdd\uff0c\u4e5f\u6ca1\u51e0\u4e2a\u9875\u9762\uff0c\u76f4\u63a5\u624b\u5de5\u505a\u4e2a\u4f2a\u9759\u6001\u89c4\u5219\u5c31\u597d\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>30826<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:52:08\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6715\u7684\u5927\u6e05\u5b8c\u4e86\uff1f \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 20:42<br \/>  \u6846\u67b6\u4e0d\u9999\u5417\uff1f<\/p>\n<p>  \u81ea\u5df1\u5199\u7684\u8bdd\uff0c\u4e5f\u6ca1\u51e0\u4e2a\u9875\u9762\uff0c\u76f4\u63a5\u624b\u5de5\u505a\u4e2a\u4f2a\u9759\u6001\u89c4\u5219\u5c31\u597d\u4e86 &#8230;<\/p>\n<p> \u5f3a\u8feb\u75c7\u554a\uff0c\u5b9e\u5728\u61d2\u5f97\u5199\u4e00\u5806\u4f2a\u9759\u6001\u89c4\u5219\u2026\u2026<br \/>  \u50cf\u6211\u8fd9\u79cdWP\u7684\u4f2a\u9759\u6001\u53ef\u4ee5\u76f4\u63a5\u62ff\u6765\u7528\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u963f\u826f<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 21:32:29\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u9a6c\u514b\u4e00\u4e0b\u3002\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u79d8\u5bc6<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 21:39:34\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5148\u6536\u85cf\u4e00\u4e0b\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>lunone<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-18 21:50:45\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6070\u5de7\u524d\u4e00\u6bb5\u641e\u8fc7\u8fd9\u73a9\u610f\uff0c\u770b\u5927\u4f6c\u7528\u7684\u662fREQUEST_URI\uff0c\u5b9e\u9645\u4e0aREQUEST_URI,\u4e5f\u5e76\u4e0d\u5b8c\u5168\u4e00\u81f4\uff0c\u6211\u770b\u5230\u8fd8\u7279\u610f\u8fc7\u6ee4\u4e86\u4e00\u4e0bqueryString\uff0c\u5176\u5b9e\u5404\u4e2a\u670d\u52a1\u5668\u9ed8\u8ba4\u884c\u4e3a\u548c\u914d\u7f6e\u8fd8\u771f\u4e0d\u4fdd\u9669\u7684\u3002\u5fd8\u4e86\u5177\u4f53\u5fc3\u8def\u5386\u7a0b\u4e86\u3002\u5728\u5c1d\u8bd5\u8fc7\u597d\u591a\u7248\u672c\u60c5\u51b5\u4e0b\uff0c\u73b0\u5728\u7684\u9009\u62e9\u662f\u4f18\u5148path_info\uff0c\u5176\u6b21request_uri,\u6700\u540e\u5b9e\u5728\u4e0d\u884c\u7528SCRIPT_NAME\u3002\u6bcf\u4e2a\u670d\u52a1\u5668\u5177\u4f53\u60c5\u51b5\u90fd\u4e0d\u590d\u6742\uff0c\u60f3\u5199\u51fa\u4e00\u4e2a\u80fd\u901a\u7528\u5339\u914d\u7684\u8fd8\u771f\u662f\u5934\u5927\u3002\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>30826 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 202&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/20056"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20056"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/20056\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20056"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}