0

对于我的 codeigniter 应用程序,我的 routes.php 中有以下设置:

   $route['default_controller'] = 'Welcome';

在我的配置文件中,我有以下内容:

    $config['base_url'] = 'http://myserver/gpohelp/'

当我尝试导航到

     http://myserver/gpohelp/

     http://myserver/gpohelp/index.php

我收到 404 错误。

但如果我执行以下操作,页面会正确加载:

    http://myserver/gpohelp/index.php/Welcome

你能告诉我我做错了什么吗?我确信这很简单,因为代码在我的开发环境中可以正常工作。我只是将应用程序移动到新服务器......它并不高兴。

4

2 回答 2

0

我的猜测是,您的服务器可能未配置为index.php首先查找,它可能正在查找index.html404 中的哪个结果。

检查您的 Apache 日志以查看,它们应该会告诉您找不到 404 文件。因为如果你这样做http://myserver/gpohelp/index.php/Welcome并且它有效,那意味着它应该适用于:

http://myserver/gpohelp/index.php

那么如果你在没有 的情况下尝试上述方法会发生什么/Welcome

于 2012-06-28T16:51:45.360 回答
0

哟需要编辑 .htaccess 文件:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

用户指南中所述

于 2012-06-28T14:39:46.787 回答