我在Nginx服务器上运行CodeIgniter 3.0.6,子路径最终服务于/index.php
,而不是/<installdir>/index.php
。因此,如果我要求/CodeIgniter-3.0.6/home/
,我将按照预期的方式替换/index.php
页面,而不是/CodeIgniter-3.0.6/index.php
。请注意,我的CodeIgniter应用程序最终将驻留在/2016/
中。CodeIgniter在Nginx上调用/index.php而不是/basefolder/index.php?
我怀疑这是由于我的Nginx安装配置错误,而不是与CodeIgniter相关的东西?我的Nginx安装在Ubuntu 16.04上运行。/etc/nginx/sites-enabled/default的内容为:
location/{
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
include fastcgi.conf;
}
是否还有其他我应该更改的内容?
你需要'/ index.php'还是只需要改变'try_files'的默认值?有关更多信息,请参见[本文档](http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files)。 –
我会尝试没有。我正在以其他一些例子为基础。 –