codeigniter 404页面未找到错误

时间:2017-08-14 09:36:08

标签: php codeigniter

我是codeigniter的新手。

客户已向我们提供已开发的codeigniter代码。它在我的本地服务器上正常工作。

将文件上传到我的演示服务器时显示

404 Page Not Found
The page you requested was not found.

在index.php末尾有一行

require_once BASEPATH.'core/CodeIgniter.php';

如果我在此行之前回显任何内容,则会显示。如果我在此行之后回显没有任何显示。

以下是htaccess行

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /demos/stallbook/index.php?/$1 [L]

在配置

$config['base_url'] = 'http://domainname.com/demos/stallbook/';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = "REQUEST_URI";

在routes.php中

$route['default_controller'] = "admin/Dashboard";

此代码停止在core/CodeIgniter.php

中工作

我分析了这段代码。在这里,他们将路由视为

  $RTR =& load_class('Router', 'core');
  $RTR->_set_routing();

 // Set any routing overrides that may exist in the main index file
  if (isset($routing))
  {
     $RTR->_set_overrides($routing);
  }

此代码在$RTR->_set_routing();行之后停止工作。

我不知道该怎么做。但在本地服务器,它的工作正常和良好。

请帮帮我。它完全令人沮丧。

1 个答案:

答案 0 :(得分:0)

Just add the line in the .htaccess files **rewritebase /demos/stallbook/** and check.

如果它不起作用,请告诉我......