简体   繁体   中英

codeigniter 404 page not found error

I am new to codeigniter.

Client gave the already developed codeigniter code to us. Its working fine in my local server.

While upload the files to my demo server it shows

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

in the index.php at the end there is the line as

require_once BASEPATH.'core/CodeIgniter.php';

If I echo anything before this line it is displayed. If I echo after this line nothing displayed.

Below is the htaccess lines

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

In config

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

In routes.php

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

This code stops working in core/CodeIgniter.php

I analysed this code. Here they intitate the routing as

  $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);
  }

This code stops working after $RTR->_set_routing(); line.

I dont know what to do this. But in local server its working fine and good.

Please help me. Its totally frustrating.

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

让我知道它是否不起作用...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM