服务器在用了nginx做代理之后,在安装onethink.这时要访问后台模块的话需要通过http://localhost/index.php?s=/admin/index/index.html来访问,而通过http://localhost/admin访问是报404的,而且http://localhost/home/index/index去访问首页也是会报404.
这时需要修改两个地方
第一个就是在Application/Common/conf/config.php中有个地方是URL配置
/* URL配置 */
'URL_CASE_INSENSITIVE' => true, //默认false 表示URL区分大小写 true则表示不区分大小写 'URL_MODEL' => 2, //URL模式 'VAR_URL_PARAMS' => '', // PATHINFO URL参数变量 'URL_PATHINFO_DEPR' => '/', //PATHINFO URL分割符把URL_MODEL的值修改成2,默认是3
第二就是修改nginx里面网站的配置
在/usr/local/nginx/conf/vhost/xxxxx.conf
在里面增加
location / {
if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } }这样一段代码,然后重启nginx.就可以了