-1

在我的本地计算机上,我正在使用 xampp 并且 codeigniter 正在运行,但是在我将 codeigniter 应用程序移动到服务器后,我收到 404 错误 Not found。

The requested URL /app/index.php/Welcome was not found on this server.

Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny16 with Suhosin-Patch Server at XXXXXXXXX.com.au Port 81

我试过改变配置

$config['base_url']= 'http://XXXXXXXXX.com.au/';
$config['uri_protocol'] = 'REQUEST_URI';

但它并没有解决问题。有任何想法吗?

4

3 回答 3

1

答案就在这里——大写的“W”。

The requested URL /app/index.php/Welcome was not found on this server.

您从 Windows WAMP 设置转移到我敢打赌 Linux Apache/PHP 服务器。

Windows 不区分大小写。Linux 区分大小写。

因此,请确保您所有的大小写都是正确的。将“欢迎”更改为“欢迎”

编辑 - 澄清它应该是这样的:

文件名: “welcome.php”<-小写“w”

类名:欢迎类扩展 CI_Controller {} <- 大写“W”

调用路由: redirect ('welcome') <- 小写“w”

于 2012-08-28T03:32:48.310 回答
0

CodeIgniter 文档说通常最好将 base_url 字段留空,这样它就可以自己确定正确的 URL。尤其强调 CI2。

于 2012-08-28T01:30:16.520 回答
0

如果您的应用程序安装在 中/app,那么您需要将 base_url 更新为:

$config['base_url']= 'http://XXXXXXXXX.com.au/app/';
于 2012-08-28T01:19:48.337 回答