微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – 404页面找不到你请求的页面在codeigniter中找不到

我们的代码如下

应用/配置/ config.PHP

$config['base_url'] = 'http://myworldmirror.com/';  
$config['index_page'] = 'index.PHP/home';

的.htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$index.PHP/$1 [L]
Options -Indexes

应用/配置/ database.PHP

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'newsels1',
    'password' => 'newsels1',
    'database' => 'newsels1',
    'dbdriver' => 'MysqL',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

产量

当我打开此URL“http://myworldmirror.com/”时,会显示以下输出

解决方法:

试试这个

更改$config [‘index_page’] =’index.PHP / home’; To $config [‘index_page’] =”;

的.htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$index.PHP?$1

检查application / config / routes.PHP中的认控制器值

$route [‘default_controller’] =’welcome’;

检查application / controllers / Welcome.PHP是否存在,否则将$route [‘default_controller’]值更改为您的要求

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐