php - 404 page not found 您请求的页面在 codeigniter 中找不到

标签 php .htaccess 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/”时,显示以下输出

Error image

最佳答案

试试这个

更改$config['index_page'] = 'index.php/home'; $config['index_page'] = '';

.htaccess

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

检查 application/config/routes.php 中的默认 Controller 值

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

检查application/controllers/Welcome.php 是否存在否则根据您的要求更改$route['default_controller']值 p>

关于php - 404 page not found 您请求的页面在 codeigniter 中找不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42002599/

相关文章:

php - 如果发生数据库查询错误,CodeIgniter 3不会返回false

php - 有没有比 fopen() 更快的函数?

php - mysql与php的多个查询

.htaccess - Laravel 4 .htaccess 不重写 URL

php - 如何设置用户角色和权限?

php - var_dump 变量在 php 中不返回任何内容

5.2 中的 php dateTime::createFromFormat?

php - 如何使用类继承表获取自定义字段的结果计数?

php - 子目录中的 CodeIgniter 站点,htaccess 文件可能会干扰主目录中的 htaccess 文件?

Apache .htaccess 将 index.html 重定向到 root,为什么是 FollowSymlinks 和 RewriteBase?