midea2 发表于 2017-12-23 09:35:28

让thinkphp 5 支持pathinfo 的 nginx ,去掉index.php

对于下面这个网址:  http://www.test.com/index.php/foo/bar.html?c=index&m=search
  我们可以得到 $_SERVER['PATH_INFO'] = ‘/foo/bar.html’,而此时 $_SERVER['QUERY_STRING'] = 'c=index&m=search';
  通常,我们最初开始PHP程序编写的时候,都会使用诸如: http://www.test.com/index.php?c=search&m=main 这样的URL,这种URL不仅看起来非常奇怪,而且对于搜索引擎也是非常不友好的。
  很多搜索引擎收录的时候,都会忽略Query String之后的内容,google虽然不会忽略Query String,但是对于其他不含Query String的页面,会给于比较高的PR值。
页: [1]
查看完整版本: 让thinkphp 5 支持pathinfo 的 nginx ,去掉index.php