无法访问Code Igniter中的默认控制器

时间:2017-04-18 13:37:53

标签: php codeigniter web-deployment

大家好我不熟悉codeigniter我已经开发了应用程序并上传到服务器我无法访问默认控制器帮我解决它。这是我的链接

http://www.digitalmarketingbangalore.in/demobox/koooly

的config.php

$config['base_url'] = 'http://www.digitalmarketingbangalore.in/demobox/koooly';
$config['index_page'] = '';

routes.php文件

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

$route['404_override'] = '';
$route['translate_uri_dashes'] = TRUE;
$route['admin'] = 'admin/dashboard';

控制器:用户

    <?php
    defined('BASEPATH') OR exit('No direct script access allowed');

    class User extends CI_Controller {


            public function index()
            {
                    $this->load->view('login');
            }

}


?>

的.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond $1 !^(index\.php|images|asset|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

2 个答案:

答案 0 :(得分:0)

.htaccess添加到以下位置

/ demobox / koooly /

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond $1 !^(index\.php|images|asset|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

和config / config.php  改变

$config['base_url'] = 'http://www.digitalmarketingbangalore.in/demobox/koooly';
$config['index_page'] = '';

答案 1 :(得分:0)

更新您的配置,使其如下所示

$config['base_url'] = 'http://www.digitalmarketingbangalore.in/demobox/koooly/';