Php 无法访问代码点火器中的默认控制器
大家好,我是codeigniter的新手,我已经开发了应用程序并上传到服务器,我无法访问默认控制器,请帮助我解决这个问题。这是我的链接 config.phpPhp 无法访问代码点火器中的默认控制器,php,codeigniter,web-deployment,Php,Codeigniter,Web Deployment,大家好,我是codeigniter的新手,我已经开发了应用程序并上传到服务器,我无法访问默认控制器,请帮助我解决这个问题。这是我的链接 config.php $config['base_url'] = 'http://www.digitalmarketingbangalore.in/demobox/koooly'; $config['index_page'] = ''; routes.php $route['default_controller'] = 'user'; $route['40
$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>
重新启动发动机
1美元^(索引\.php | images | asset | robots\.txt)
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?/$1[L]
.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['base_url'] = 'http://www.digitalmarketingbangalore.in/demobox/koooly/';
得到什么错误?我认为.htacess有问题。请检查或编辑帖子。在config.php和.htaccess设置中使用它的workingremove index.php,直到找不到相同的404页面。如果在config.php中删除index.php,还可以添加.htaccess???$config['index_page']='';config.phpyeah中的更改我已通过您的代码更改了配置并更新了htaccess代码
$config['base_url'] = 'http://www.digitalmarketingbangalore.in/demobox/koooly/';